I'm trying to remove textbox controls, it gave me error..the error is in the if statement, but I dont' know why. the Panel1.Controls.Count = 42, and when it count to Panel1.Controls.Count(21), it said index 21 is out of range.
any idea?
Dim ctrl As Control
Dim txtBox As TextBox
For i As Integer = 0 To Panel1.Controls.Count - 1
If Panel1.Controls(i).GetType().Equals(GetType(TextBox)) Then
Panel1.Controls.RemoveAt(i)
End If
Next
any idea?
Dim ctrl As Control
Dim txtBox As TextBox
For i As Integer = 0 To Panel1.Controls.Count - 1
If Panel1.Controls(i).GetType().Equals(GetType(TextBox)) Then
Panel1.Controls.RemoveAt(i)
End If
Next