Yliah Yliah - 9 days ago 6
Vb.net Question

Looping of textboxes that has values (integer)

Ive been thinking of how to loop my textboxes that has integer as a value. Please help me with this problem, thank you in advance.

Answer

If your application is Windows Form, this is how you can get all integer values...

Dim intList As New List(Of Integer)()
For Each c As Control In Me.Controls
    If c.GetType Is GetType(TextBox) Then
        If Integer.TryParse(c, 0) Then
            intList.Add(Convert.toInt32(c.Text))
        End If
    End If
Next
Comments