一个简单的例子,遍历当前Form下所有TextBox并将Text属性设置为空
Dim ct As Control
For Each ct As Control In Me.ControlsVB.net遍历WinForm下所有控件
If TypeOf ct Is TextBox Then
ct.Text = ""VB.net遍历WinForm下所有控件
End IfVB.net遍历WinForm下所有控件
Next
一个简单的例子,遍历当前Form下所有TextBox并将Text属性设置为空
Dim ct As Control
For Each ct As Control In Me.ControlsVB.net遍历WinForm下所有控件
If TypeOf ct Is TextBox Then
ct.Text = ""VB.net遍历WinForm下所有控件
End IfVB.net遍历WinForm下所有控件
Next