1
我想循環遍歷窗口中的組件,但它永遠不會通過窗口到其子組件。我究竟做錯了什麼?recusive循環通過在VB中不工作的組件
Public Sub fixUIIn(ByRef comp As System.ComponentModel.Component, ByVal style As SByte)
Debug.WriteLine(comp)
If TypeOf comp Is System.Windows.Forms.ContainerControl Then
Dim c As System.Windows.Forms.ContainerControl
c = comp
c.BackColor = getColor(style, PART_BACK)
c.ForeColor = getColor(style, PART_TEXT)
If ((comp.Container IsNot Nothing) AndAlso (comp.Container.Components IsNot Nothing)) Then
For i As Integer = 0 To comp.Container.Components.Count() Step 1
fixUIIn(comp.Container.Components.Item(i), style)
Next
End If
comp = c
End If
End Sub
謝謝...一旦我得到Visual Studio GUI生成器不會失敗,我會實現它 – Supuhstar 2011-04-28 00:32:55