Dim zcdd As WinForm.Button
If dr("窗口按键_菜单") < > Nothing Then
Dim Value1 As String = dr("窗口按键_按键")
Dim Value2 As String = dr("窗口按键_数据视图")
Dim Value3 As String = dr("窗口按键_导出报表")
Dim Value As String = dr("窗口按键_菜单")
Dim sps() As Char = {"|"}
Dim Names() As String = Value.Split(sps)
Dim s As Integer = 2
Dim t As Integer = 5
For i As Integer = 0 To Names.length - 1
If i <> 0 Then
If i Mod 3 = 0 Then
s = 2
t = t + 41.9
Else
s = s + 72.9
End If
End If
Dim nm As String = Names(i)
zcdd = Forms("主窗_菜单").CreateControl(nm, ControlTypeEnum.Button)
zcdd.Theme = "(none)" '去掉原来的样式
zcdd.Font = New Font("宋体", 9, FontStyle.Regular)
zcdd.Text = nm
zcdd.name = nm
zcdd.Width = 72
zcdd.Height = 41
zcdd.Left = s + 8
zcdd.Top = t + 2
zcdd.BorderSize = 0
希望达成如下效果
此主题相关图片如下:企业微信截图_20240305112910.png
lvw.Groups.Add("按键") '添加分组
lvw.Groups.Add("视图") '添加分组
lvw.Groups.Add("报表") '添加分组
For Each nm As String In Value1
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
vr.Text = nm '设置行标题
vr.Group = "按键" '设置行的分组
Next
For Each nm As String In Value2
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
vr.Text = nm '设置行标题
vr.Group = "视图" '设置行的分组
Next
For Each nm As String In Value3
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
vr.Text = nm '设置行标题
vr.Group = "报表" '设置行的分组
Next
Forms("主窗_菜单").Controls("菜单页面").Tabpages("功能操作").AddControl(zcdd)
zcdd.ToolTip = zcdd.Text '动态提示
Next
End If
[此贴子已经被作者于2024/3/5 11:29:58编辑过]