If e.Node.Nodes.Count=0 Then
e.Form.StopRedraw
Dim tab As WinForm.TabControl = e.Form.Controls("tbl_jd_serevmain_serevmain")
e.Form.Controls("tbl_jd_serevmain_serevmain").Basecontrol.borderstyle = Windows.Forms.FormBorderStyle.None'去掉边框
Dim pg As WinForm.TabPage
'添加导航按钮
Dim bttitle As String=e.Node.Name
Dim btNames As New List(Of String)
Dim pnl As WinForm.Panel=Forms("serevmain").controls("pnl_serevmain_serevmain")
For Each c As object In pnl.Children
If Typeof c Is WinForm.Panel Then
btNames.Add(c.name)
c.backColor = Color.lightblue
End If
Next
Dim btn As object
If tab.TabPages.Contains("pg_serevmain_" & e.Node.Name) = False Then
'添加页面
pg = tab.TabPages.Add("pg_serevmain_" & e.Node.Name,e.Node.Name)
Dim tbl As WinForm.Table
tbl= e.Form.CreateTable("tab_serevmain_" & e.Node.Name,e.Node.Name,False)
tbl.Table.AllowEdit=False
e.Form.AddControl(tbl)
tbl.Table.Filter=""
''重新生成表头
Functions.Execute("za_nb_tablerename",tbl)
Functions.Execute("za_nb_tableover",DataTables(e.Node.Name))
''重新生成表头
'tbl.Enabled=False
tbl.Visible=False
tbl.Table.DataTable.SysStyles("Alternate").BackColor=Color.LightGray
tbl.Table.DataTable.SysStyles("EmptyArea").BackColor = Color.White
tbl.Table.DataTable.SysStyles("CurrentRow").BackColor = Color.FloralWhite
tbl.Table.DataTable.MultiRowHeader = False
tbl.Table.ListMode = True
tbl.dock=5
tbl.Visible=True
pg.AddControl(tbl)
tab.SelectedPage=PG
'添加页面
'添加导航按钮
btn = Forms("serevmain").CreateControl("pnl_tit_serevmain_" & bttitle,ControlTypeEnum.Panel)
btn.Visible = True
btn.backColor = Color.GreenYellow
btn.BaseControl.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
btn.BaseControl.dock=System.Windows.Forms.DockStyle.Left
btn.BaseControl.anchor=System.Windows.Forms.AnchorStyles.Left
btn.BaseControl.BackgroundImage = GetImage(Functions.Execute("za_nb_addtoplogo",btn,0,True))
btn.Dock = 3
btn.TopMost=True
btn.width = 110'下面还有一个110数字要一样
Dim la As WinForm.Label = Forms("serevmain").CreateControl("lab_tit_serevmain_" & e.Node.Name,ControlTypeEnum.Label)
la.text = e.Node.text
la.Top = 12
la.left =30
la.topMost=False
la.Enabled=False
la.AutoSize = True
btn.AddControl(la)
pnl.AddControl(btn)
btn.Height = btn.parent.height
pg.Visible=True
'添加导航按钮结束
End If
Else
pg=tab.tabpages("pg_serevmain_" & e.Node.name)
tab.SelectedPage=PG
If pg IsNot Nothing Then
btn = Forms("serevmain").Controls("pnl_tit_serevmain_" & bttitle)
btn.backColor = Color.GreenYellow
btn.Dock = 3
btn.width = 110'上面还有一个110数字要一样
pg.Visible=True
End If
End If
If vars("p_serevmain_pidx").Contains(bttitle) = False Then'关闭再打开需要重新加载PAGE顺序使用
vars("p_serevmain_pidx").add(bttitle)
Functions.Execute("za_nb_zaformset",e,e.Node.name)
End If
E.Form.ResumeRedraw
End If