dim s as string
s="1,2,3,4,5"
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 + i*120
btn.width=Values(Index).length*25
btn.Top = y
If Index>0 Then
Dim btn1 = f.CreateControl("bt1" & Values(Index), ControlTypeEnum.button)
btn1.Left = x + i*120+btn.width
btn1.width=75
btn1.Top = y
f.Controls("pan2").AddControl(btn1)
End If
i = i+1
If i Mod 7 = 0 Then
i = 0
x = 10
y += 25
End If
f.Controls("pan2").AddControl(btn)
Next
Else
f.Controls("pan2").basecontrol.controls.clear
End If
上面这个代码是想根据S的内容生成一个动态的按钮组,当S内的顺序大于1时 在2个按钮之间插入一个链接按钮
写到这个地方卡住了
想实现如下图所示的效果
此主题相关图片如下:201771115575048166.png