怎么在VB中清空窗体上全部TextBox上的内容

2025-01-07 03:32:32
推荐回答(3个)
回答1:

Private Sub Command1_Click()
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Then ctl.Text = ""
Next ctl
End Sub

回答2:

Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
End Sub不管有多少文本 都可以按这个易懂的方法

回答3:

TextBox1.Clear