Dim e =args(0)
Dim pnl As WinForm.Panel=args(1)
Dim Striptab As WinForm.Strip
Dim StriptabName As String=pnl.name.Replace("pnl","menu")
If forms("serevmain").Strips.Contains(StriptabName) Then
forms("serevmain").Strips.Remove(StriptabName)
End If
Dim dt As DataTable=Functions.Execute("tablloading","usperation")
Select Case pnl.name.split("_")(0)
Case "toolpnl"
Striptab= FormS("serevmain").Strips.Add(StriptabName, StripTypeEnum.MainMenu)
Striptab.Items.Add(StriptabName.replace("toolmenu","gb_"),"","Tools_exit.png",StripItemTypeEnum.Button)
Striptab.Items(StriptabName.replace("toolmenu","gb_")).DisplayText = False
Striptab.Items(StriptabName.replace("toolmenu","gb_")).DockToRight = True '靠右停放
Case "findpnl"
Striptab= FormS("serevmain").Strips.Add(StriptabName, StripTypeEnum.ToolBar)
Case "stripnl"
Striptab= FormS("serevmain").Strips.Add(StriptabName, StripTypeEnum.StatusBar)
End Select
pnl.basecontrol.controls.add(Striptab.basecontrol)
'添加菜单按钮分割线
Dim drsbj As List (of DataRow)
drsbj=dt.Select(pnl.name.split("_")(0) & "=true" & " and id='"& pnl.name.split("_")(2) &"'","itmoder")
If drsbj.count>0 Then
Dim i1 As Integer=0
For Each dr1 As DataRow In drsbj
Select Case dr1("mentype")
Case "StripItemTypeEnum.Separator"
Striptab.Items.Add(pnl.name.Replace("pnl","Separator" & i1 ),"","",StripItemTypeEnum.Separator)
Case "StripItemTypeEnum.MenuItem"
Dim drslsb As DataRow=lsb("readrules").find("tbltname='zamenuset' And tblcolid='menuid'")
If drslsb IsNot Nothing Then
Dim count As Integer= 0
Dim count2 As Integer= 0
For i As Integer = 0 To drslsb("colong").length - 1
count += val(drslsb("colong").chars(i))
count2=val(drslsb("colong").chars(i))
If count <= dr1("menuid").length Then
Dim str As String = dr1("menuid").Substring(0,count)
'Dim drf As DataRow=dt.find(pnl.name.split("_")(0) & "=true And id='" & pnl.name.split("_")(2) & "' And mentype='"& dr1("mentype") &"' And menuid like'"& str &"%' And menuid <> '"& str &"'")
'Dim drf As DataRow=dt.find(pnl.name.split("_")(0) & "=true And id='" & pnl.name.split("_")(2) & "' And mentype='"& dr1("mentype") &"' And menuid ='"& str &"'")
''If drf IsNot Nothing Then
Dim drf2 As DataRow=dt.find(pnl.name.split("_")(0) & "=true And id='" & pnl.name.split("_")(2) & "' And mentype='"& dr1("mentype") &"' And menuid ='"& str.SubString(0,str.length-count2) &"'")
If drf2 IsNot Nothing Then
If Striptab.Items.Contains(str.SubString(0,str.length-count2))=False Then
Dim dr2 As DataRow=dt.find("menuid='"& str.SubString(0,str.length-count2) &"'")
If dr2 IsNot Nothing Then
Striptab.Items.Add(str.SubString(0,str.length-count2),dr2("poutcaption"),dr2("imgsmlt"),val(dr2("mentype")))'还要改下
End If
Else
Dim Stripitm As WinForm.StripItem= Striptab.Items(str.SubString(0,str.length-count2))
If Stripitm.Items.Contains(str)=False Then
Dim dr2 As DataRow=dt.find("menuid='"& str &"'")
If dr2 IsNot Nothing Then
Stripitm.Items.Add(str,dr2("poutcaption"),dr2("imgsmlt"),val(dr2("mentype")))
End If
End If
End If
Else
If Striptab.Items.Contains(str)=False Then
Dim dr2 As DataRow=dt.find("menuid='"& str &"'")
If dr2 IsNot Nothing Then
Striptab.Items.Add(str,dr2("poutcaption"),dr2("imgsmlt"),val(dr2("mentype")))
End If
End If
End If
End If
Next
End If
Case "StripItemTypeEnum.Label","StripItemTypeEnum.SplitButton","StripItemTypeEnum.Button"
Striptab.Items.Add(dr1("menuid"),dr1("poutcaption"),dr1("imgsmlt"),val(dr1("mentype")))
Striptab.Items(dr1("menuid")).DisplayText = True
End Select
i1=i1+1
Next
End If