Dim Striptab As WinForm.Strip= e.Form.Strips.Add("", StripTypeEnum.MainMenu) '添加菜单按钮分割线 Dim DT As DataTable=DataTables("表A") Dim levels As new List(of object) levels.add(striptab) For Each dr1 As DataRow In DataTables("表A").Select("", "menuid") Dim T = Nothing Select Case dr1("mentype") Case "StripItemTypeEnum.MenuItem" t = StripItemTypeEnum.MenuItem Case "StripItemTypeEnum.Button" 't = StripItemTypeEnum.Button t = StripItemTypeEnum.MenuItem Case "StripItemTypeEnum.Separator" t = StripItemTypeEnum.Separator End Select If t IsNot Nothing Then For i As Integer = levels.count-1 To 0 Step -1 If dr1("menuid").contains(levels(i).name) Then Dim obj = levels(i).Items.Add(dr1("menuid"),dr1("poutcaption"),dr1("imgsmlt"),t) obj.text = dr1("poutcaption") levels.add(obj) Exit For End If Next End If Next
|