0
如何通过循环遍历容器中的所有控件以及包含控件的容器中的所有控件等等。VB.NET迭代通过控件容器
Form
-Panel
--Control
--Tab
----Control
----Control
--Tab
----Control
只检索 - 面板,没有其他控件
For Each cntrl As Control In Me.Controls
Next
我怎样才能找回他们都在一个For Each循环,而不下面的IF /然后在堆栈的每级?
编辑:
Dim ctl As Control = Me
Do
ctl = Me.GetNextControl(ctl, True)
'Do whatever you have to ctl
Loop Until ctl Is Nothing
这是迄今为止我发现这样做的最佳方法。
这就是我发现也是最好的。 – dbasnett 2011-12-17 13:36:27