--
大概就是这样,为啥 findpnl 总是跑到toolpnl顶上去 ,后加的应该在后面啊
Dim e =args(0)
Dim frm As String=args(1)
Forms(frm).StopRedraw
Dim tab As WinForm.TabControl = Forms(frm).Controls("tbl_jd_" & frm & "_" & frm)
Dim pg As WinForm.TabPage
pg=tab.SelectedPage
If Forms(frm).ExistControl(pg.name.Replace("pg_","pnl_xs_")) Then
Forms(frm).RemoveControl(pg.name.Replace("pg_","pnl_xs_"))
End If
Dim pmxs As WinForm.Panel=Forms(frm).CreateControl(pg.name.Replace("pg_","pnl_xs_"),ControlTypeEnum.Panel)
pmxs.Visible=False
pmxs.Dock=System.Windows.Forms.DockStyle.fill
pmxs.Height=22
pg.AddControl(pmxs)
If pg IsNot Nothing Then
Dim dt As DataTable=Functions.Execute("tablloading","usformset")
Dim dr As DataRow=dt.find("id=\'"& pg.name.Replace("pg_" & frm & "_","") &"\' And parentfrmid=\'"& pg.name.split("_")(1) &"\'")
If dr IsNot Nothing Then
For Each dc As DataCol In dt.DataCols
Select Case dc.name
Case "toolpnl"
If dr(dc.name)=True Then
If Forms(frm).Strips.Contains(dc.name & "_" & frm & "_" & pg.name.split("_")(2)) Then
Forms(frm).Strips.Remove(dc.name & "_" & frm & "_" & pg.name.split("_")(2))
End If
Dim Striptab1 As WinForm.Strip
Select Case frm
Case "serevmain"
Striptab1=Forms(frm).Strips.Add(dc.name & "_" & frm & "_" & pg.name.split("_")(2), StripTypeEnum.MainMenu)
Striptab1.Items.Add(pg.name.replace("pg","exit"),"","Tools_exit.png",StripItemTypeEnum.Button)
Striptab1.Items(pg.name.replace("pg","exit")).DisplayText = False
Striptab1.Items(pg.name.replace("pg","exit")).DockToRight = True \'靠右停放
Case Else
Striptab1=Forms(frm).Strips.Add(dc.name & "_" & frm & "_" & frm, StripTypeEnum.MainMenu)
Striptab1.Items.Add("exit_" & frm & "_" & frm,"","Tools_exit.png",StripItemTypeEnum.Button)
Striptab1.Items("exit_" & frm & "_" & frm).DisplayText = False
Striptab1.Items("exit_" & frm & "_" & frm).DockToRight = True \'靠右停放
End Select
Functions.Execute("za_nb_stripafterload",e,Striptab1,pmxs,frm)
End If
Case "findpnl"
If dr(dc.name)=True Then
If Forms(frm).Strips.Contains(dc.name & "_" & frm & "_" & pg.name.split("_")(2)) Then
Forms(frm).Strips.Remove(dc.name & "_" & frm & "_" & pg.name.split("_")(2))
End If
Dim Striptab2 As WinForm.Strip
Select Case frm
Case "serevmain"
Striptab2= Forms(frm).Strips.Add(dc.name & "_" & frm & "_" & pg.name.split("_")(2), StripTypeEnum.ToolBar)
Case Else
Striptab2= Forms(frm).Strips.Add(dc.name & "_" & frm & "_" & frm, StripTypeEnum.ToolBar)
End Select
Functions.Execute("za_nb_stripafterload",e,Striptab2,pmxs,frm)
End If
End Select
Next
End If
End If
If frm="serevmain" Then
pmxs.Visible=True
pmxs.topmost=True
End If
Forms(frm).ResumeRedraw
[此贴子已经被作者于2018/7/5 23:13:44编辑过]