Free Blog Counter

Ranjiths Dot Net Blog: How to clear text boxes of a GroupBox in VB.Net

Friday, 15 August 2008

How to clear text boxes of a GroupBox in VB.Net

Everybody has to start somewhere. Specially, programming in VB.Net is somewhat interesting thing to do.

The code below will help a novice software developer to clear the text boxes of Groupbox in VB.Net:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim ctl As Control


For Each ctl In GroupBox1.Controls
If TypeOf ctl Is TextBox Then
ctl.Text = ""
End If
Next
End Sub

No comments: