A
Asif
Hi All,
I am using the following code to add new Menu Item In Context Menu:
Dim AApp As VisioApp
Dim UIObj As Visio.UIObject
Dim menuSetsObj As Visio.MenuSets
Dim menuSetObj As Visio.MenuSet
Dim menusObj As Visio.Menus
Dim menuObj As Visio.Menu
Dim menuItemsObj As Visio.MenuItems
Dim menuItemObj As Visio.MenuItem
Set AApp = Application
Set UIObj = AApp.BuiltInMenus
'get the MenuSets collection
Set menuSetsObj = UIObj.MenuSets
Set menuSetObj = menuSetsObj.ItemAtID(visUIObjSetCntx_DrawObjSel)
Set menuObj = menuSetObj.Menus(0)
Set menuItemObj = menuObj.MenuItems.AddAt(0)
menuItemObj.Caption = "My Context Menu"
AApp.SetCustomMenus UIObj
The code is working fine and a new MenuItem named "My Context Menu" i
also visible but the issue is there that I need some operation whe
user clicks "My Context Menu".
Can anyone help me about how to write an Event Handler for menu item.
Thanks
Asi
I am using the following code to add new Menu Item In Context Menu:
Dim AApp As VisioApp
Dim UIObj As Visio.UIObject
Dim menuSetsObj As Visio.MenuSets
Dim menuSetObj As Visio.MenuSet
Dim menusObj As Visio.Menus
Dim menuObj As Visio.Menu
Dim menuItemsObj As Visio.MenuItems
Dim menuItemObj As Visio.MenuItem
Set AApp = Application
Set UIObj = AApp.BuiltInMenus
'get the MenuSets collection
Set menuSetsObj = UIObj.MenuSets
Set menuSetObj = menuSetsObj.ItemAtID(visUIObjSetCntx_DrawObjSel)
Set menuObj = menuSetObj.Menus(0)
Set menuItemObj = menuObj.MenuItems.AddAt(0)
menuItemObj.Caption = "My Context Menu"
AApp.SetCustomMenus UIObj
The code is working fine and a new MenuItem named "My Context Menu" i
also visible but the issue is there that I need some operation whe
user clicks "My Context Menu".
Can anyone help me about how to write an Event Handler for menu item.
Thanks
Asi