【发布时间】:2015-03-06 15:00:15
【问题描述】:
- 我有一个包含 3 个标签页的标签控件。
- 每个标签页都包含一个组框。
- 每个组框都包含不同的控件。
我想要发生的是,当用户点击按钮时,所有标签页中的所有文本框都被清除。
我使用了这个代码:
For Each page As TabPage In TB_Emp.TabPages
For Each ctl As Control In page.Controls
If TypeOf ctl Is TextBox Then
ctl.Text = ""
End If
If TypeOf ctl Is ComboBox Then
ctl.Text = ""
End If
If ctl.HasChildren Then
For Each thing As Control In ctl.Controls
If TypeOf thing Is TextBox Then
thing.Text = ""
End If
Next
End If
Next
Next
但它只适用于第一个标签页,我想将此代码应用于所有标签控制页
【问题讨论】:
-
应该可以。这里一定有其他事情发生,您可能没有向我们展示或告诉我们。
-
如果这些控件在 groupbox 中,您就没有记帐它们。递归函数最适合您...
-
不,这是中奖申请表
标签: vb.net textbox tabcontrol