我在vb.net中有一個循環,我想要顯示50個面板,所有這些面板都具有相同的3個控件。只有最後一個控件被3個控件填充,這是爲什麼?vb.net面板控制循環問題
Dim PanelVerticalPoint As Integer = btDF.Height * 6
For counter = 1 To 50 Step +1
Dim ButtonPanel As Panel = New Panel
With ButtonPanel
ButtonPanel.Location = New Point(0, PanelVerticalPoint)
ButtonPanel.Size = New Size(btDF.Width, btDF.Height)
Me.Controls.Add(ButtonPanel)
ButtonPanel.Controls.Add(btCustomButtonMenu)
ButtonPanel.Controls.Add(btCustomTextBox)
ButtonPanel.Controls.Add(btCustomButton)
End With
PanelVerticalPoint = PanelVerticalPoint + btDF.Height
Next counter
爲什麼不使用這種自定義控件的一個非常類似的問題? –