Dim s As String Dim f As WinForm.Form=e.Form s="1,2,3,4,5,6,7,8,9" If s<>"" Then Dim Multi As String = s Dim Values() As String Values = Multi.split(",") f.Controls("pan2").basecontrol.controls.clear Dim ay As Integer = 10 Dim i As Integer = 0 Dim x As Integer = 10 Dim y As Integer = 20 For Index As Integer = 0 To Values.Length - 1 Dim btn = f.CreateControl("bt" & Values(Index), ControlTypeEnum.button) btn.Text =Index+1 & "." & Values(Index) btn.Left = x btn.width=Values(Index).length*25 btn.Top = y x += btn.width f.Controls("pan2").AddControl(btn) If Index<Values.Length - 1 Then Dim btn1 = f.CreateControl("bt1" & Values(Index), ControlTypeEnum.button) btn1.Left = x btn1.width=75 btn1.Top = y f.Controls("pan2").AddControl(btn1) x += btn1.width End If i = i+1 If i Mod 7 = 0 Then i = 0 x = 10 y += 25 End If Next Else f.Controls("pan2").basecontrol.controls.clear End If
|