以下生成菜单的代码,在AfterLoad事件中生成
Dim mnu As Winform.Strip
Dim itm As WinForm.StripItem
mnu = e.Form.Strips.Add("主菜单",StripTypeEnum.MainMenu)
mnu.Items.Add("File","文件(&F)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("Edit","编辑(&E)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("ShenHeShenPi","审核审批(&S)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("homepage","首页(&H)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("pageup","上页(&A)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("pagedown","下页(&P)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("lastpage","末页(&L)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("MuLuShu","打开目录(&M)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("GengXing","更新(&G)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("Option","选项(&O)","",StripItemTypeEnum.MenuItem)
mnu.Items.Add("Help","帮助(&H)","",StripItemTypeEnum.MenuItem)
'在主菜单右侧增加一个按钮
mnu.Items.Add("Home","主页","home.ico",StripItemTypeEnum.Button)
mnu.Items("Home").DisplayText = False
mnu.Items("Home").DockToRight = True '靠右停放
'为文件菜单增加项目
itm = mnu.Items("File")
itm.Items.Add("New","新建","new.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("Open","打开","Open.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("Save","保存","Save.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("Separator1", "分割条", "", StripItemTypeEnum.Separator)
itm.Items.Add("Print","打印","Print.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("Preview","打印预览","Preview.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("Separator2", "分割条", "", StripItemTypeEnum.Separator)
itm.Items.Add("Exit","退出","",StripItemTypeEnum.MenuItem)
'为常用项目增加快捷键
itm.Items("New").ShortcutKeys = Keys.Control Or Keys.N
itm.Items("Open").ShortcutKeys = Keys.Control Or Keys.O
itm.Items("Save").ShortcutKeys = Keys.Control Or Keys.S
itm = mnu.Items("Edit")
itm.Items.Add("AddNew","新增","new.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("ShanChu","删除","Open.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("ChaRu","插入","Save.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("ShanHang","删行","Save.ico",StripItemTypeEnum.MenuItem)
itm = mnu.Items("ShenHeShenPi")
itm.Items.Add("ShenHe","审核","new.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("QuXiaoShenHe","取消审核","Open.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("ShenPi","审批","Save.ico",StripItemTypeEnum.MenuItem)
itm.Items.Add("QuXiaoShenPi","取消审批","Save.ico",StripItemTypeEnum.MenuItem)