2011-04-27 2 views
1

창에서 구성 요소를 반복적으로 순환하려고하지만 창을 지나서 결코 하위 구성 요소로 이동하지 않습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?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 

답변

0

당신이 구성 요소가 아닌 컨트롤로 시작하지만 (예 형태로) 컨트롤 시작할 수 있다면 당신은

Public Sub fixUIIn(ByRef comp As System.Windows.Forms.Control ByVal style As SByte) 
    Debug.WriteLine(comp) 
    comp.BackColor = getColor(style, PART_BACK) 
    comp.ForeColor = getColor(style, PART_TEXT) 

     If (comp.Controls IsNot Nothing) Then 
      For i As Integer = 0 To comp.Controls.Count() 
       fixUIIn(comp.Controls.Item(i), style) 
      Next 
     End If 

End Sub 
+0

감사를 시도 할 수 있습니다 이유는 확실하지 ... 일단 Visual Studio GUI Builder가 실패하지 않으면 구현할 것입니다. – Supuhstar