control resetting
-
hi i have a no of text boxes in my form.i want to reset all text boxes by clicking the reset button. in my form..can anybody tell me how can i do it by using a loop(for..next..)nstead of doing textbox1.text="" for each one...??? i am using vb.net thanks in advance
i m pradip kishore
-
hi i have a no of text boxes in my form.i want to reset all text boxes by clicking the reset button. in my form..can anybody tell me how can i do it by using a loop(for..next..)nstead of doing textbox1.text="" for each one...??? i am using vb.net thanks in advance
i m pradip kishore
dim c as Control
For Each c In Me.Controls
If TypeOf c is TextBox Then
c.Text = ""
End If
Next
Tarakeshwar Reddy MCP, CCIE Q(R&S)
-
dim c as Control
For Each c In Me.Controls
If TypeOf c is TextBox Then
c.Text = ""
End If
Next
Tarakeshwar Reddy MCP, CCIE Q(R&S)
hi thanks for your quick response..
i m pradip kishore
-
hi i have a no of text boxes in my form.i want to reset all text boxes by clicking the reset button. in my form..can anybody tell me how can i do it by using a loop(for..next..)nstead of doing textbox1.text="" for each one...??? i am using vb.net thanks in advance
i m pradip kishore
Add the following to your Reset Button click event and it should sort out your issue:
For Each Ctl As Control In Me.Controls If TypeOf Ctl Is TextBox Then Ctl.Text = String.Empty Next
Regards, Martin