창 생성자에서 다음 코드를 실행합니다. '라벨'이 추가되지만 다른 컨트롤은 화면에 표시되지 않습니다. newTab.Controls를 디버깅 할 경우 컨트롤이 여러 개 있습니다. 왜 그들은 화면에 나타나지 않고 "레이블"컨트롤 만 볼 수 있습니다.컨트롤이 탭 페이지에 추가되지 않았습니다. VB.NET
감사
Dim graphlist As ArrayList = New ArrayList
For Each funct As TL_FUNCTION In functionlist
If (funct.functionname = functi) Then
If Not (graphlist.Contains(funct.picture)) Then
graphlist.Add(funct.picture)
End If
End If
Next
For Each picture In graphlist
Dim NewTab As New TabPage
NewTab.Name = picture
NewTab.Text = NewTab.Name
Me.TabControl1.Controls.Add(NewTab)
Me.TabControl1.SelectedIndex = Me.TabControl1.TabCount - 1
For Each func As TL_FUNCTION In functionlist
If (func.picture = picture) Then
Dim label As Label = New Label
label.Text = func.curve.ToString
NewTab.Controls.Add(label) 'This label shows up
Dim key As String
Dim values() As String
For Each key In func.values.Keys
values = func.values.GetValues(key)
For Each value As String In values
Dim label2 As New Label
label2.Text = key.ToString
Dim textb As TextBox = New TextBox
textb.Text = value
NewTab.Controls.Add(label2) 'this one is not shown on the tab
NewTab.Controls.Add(textb) 'this one is not shown on the tab
Next value
Next key
End If
Next
Next
당신이 루프가 완료되면 당신의 탭 컨트롤에'때 .refresh을()'를 호출하려고 했습니까? –
예, .Refresh()를 시도했지만 작동하지 않았습니다. – benst
'ArrayList' [더 이상 사용되지 않음] (http://stackoverflow.com/a/5063253/284240). –