老师,我想在分区面板1中生成导航,下面代码怎么改?
'生成左侧导航
Dim frm As WinForm.SplitPanel = Forms("主窗口").Controls("SplitContainer1").panel1
'For Each kj As WinForm.Control In frm.Controls
'frm.RemoveControl(kj.Name)
'Next
Dim o As new C1.Win.C1Command.C1OutBar
o.name = "o"
o.dock = 5 '锚定
o.VisualStyle = 5 'VisualStyle.Office2007Blue '页面主题
o.pagetitleheight = 30 '页面高度
Dim zaj As List(of String) = DataTables("子系统导航").GetValues("分组","","序号")
For Each za As String In zaj
Dim p1 As new C1.Win.C1Command.C1OutPage '新建页面
p1.name=za
p1.text=za
o.Pages.add(p1)
Dim ajm As List(of DataRow) = DataTables("子系统导航").Select("分组='" & za & "'","序号 Desc")
For Each aj2 As DataRow In ajm
Dim aj As String = aj2("名称")
Dim jpg As String = aj2("图标")
Dim hsmc As String =aj2("名称")
Dim abc As WinForm.Button
abc=frm.CreateControl(hsmc,ControlTypeEnum.button)
abc.Text=aj
abc.Dock= 1 '锚定
abc.Height= 30 '页面高度
abc.Image=GetImage(jpg) '图标
abc.ImageAlign= ContentAlignment.MiddleLeft '图标位置,靠左居中
abc.TextAlign = ContentAlignment.MiddleLeft '名称位置,靠左居中
abc.TextImageRelation = TextImageRelation.ImageBeforeText '图标在文本之前 Automatic '图标相对位置'自动
abc.VisualStyle= IVisualStyle.Office2010Black '按钮主题
frm.AddControl(abc)
o.Pages(za).controls.add(Forms("主窗口").Controls(hsmc).basecontrol)
Next
Next
[此贴子已经被作者于2019/3/26 10:10:23编辑过]