Home > Software engineering >  vb.net
vb.net

Time:10-07

New to.net, I ask you how big bird vb.net more than empty content in the TextBox and ComboBox control at the same time, thank you!

CodePudding user response:

For Each TB As Me In TextBox. Controls. OfType (Of) the TextBox ()
TB. Text=String. The Empty
Next

CodePudding user response:

reference 1st floor caozhy response:
For Each TB As a TextBox In Me. Controls. The OfType (Of) the TextBox ()
TB. Text=String. The Empty
Next

Thank you for your reply
At the start of the in a stupid way:
Private Sub btnClear_Click (sender As Object, As EventArgs e) Handles btnClear. Click 'to empty the contents of a text box
TxtCardNo. Text=""
TxtStudentNo. Text=""
TxtName. Text=""
CmbSex. SelectedIndex=0
TxtDepartment. Text=""
TxtGrade. Text=""
TxtClass. Text=""
CmbStatus. SelectedIndex=0
TxtRemark. Text=""
Txtbalance. Text=""
End Sub
Later found that the room charge system is more, for the function in the repetitive work is a bit repetitive,