【发布时间】:2018-11-26 01:22:18
【问题描述】:
我在清空 GroupBox 中的每个 TextBox 时遇到问题,因为我的循环仅在 textbox1 有价值时清除所有 TextBox,但如果我尝试绕过 textbox1 并跳转到输入数据到 textbox2,我的 @987654324 @ 方法不起作用。
如果需要更改,请查看我的循环代码:
Public Sub ClearCtrlText(ByVal root As Control)
For Each ctrl As Control In root.Controls
If TypeOf ctrl Is TextBox Then ' textbox set to empty string
If ctrl.Text <> "" Then
ctrl.Text = Nothing
End If
End If
Next
End Sub
【问题讨论】: