Dim Strip As WinForm.Strip
Strip = e.Form.Strips.Add("打印快捷菜单", StripTypeEnum.ContextMenu)
Strip.Items.Add("入境卫生检疫证", "入境卫生检疫证", "new.ico", StripItemTypeEnum.MenuItem)
Strip.Items.Add("出境卫生检疫证", "出境卫生检疫证", "Open.ico", StripItemTypeEnum.MenuItem)
e.Form.Controls("打印").ContextStrip = e.Form.Strips("打印快捷菜单")
以上代码,点击某个按钮就会出现两个菜单,现在想能不能将这两个菜单增加一个上级目录,比如说我点击按钮先出现一个菜单,然后挪动光标,再下一级的菜单中出现现有的这两个菜单。
这个案例里边没有类似的解决方法啊,能不能做个示例?
窗口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)
itm = mnu.Items("File")
itm.Items.Add("New", "新建", "new.ico", StripItemTypeEnum.MenuItem)
窗口中的按钮click:
'点击按钮,展示快捷菜单
With e.Sender
.ShowContextStrip(0, .Height, e.Form.Strips("打印快捷菜单"))
End With
对吗,点击无反应。
Dim Strip As WinForm.Strip
Strip = e.Form.Strips.Add("打印快捷菜单", StripTypeEnum.ContextMenu)
Dim itm As WinForm.StripItem = Strip.Items.Add("上级目录","上级目录","",StripItemTypeEnum.MenuItem)
itm .Items.Add("入境卫生检疫证", "入境卫生检疫证", "new.ico", StripItemTypeEnum.MenuItem)
itm .Items.Add("出境卫生检疫证", "出境卫生检疫证", "Open.ico", StripItemTypeEnum.MenuItem)
e.Form.Controls("打印").ContextStrip = e.Form.Strips("打印快捷菜单")