Add Event Handler In Context Menu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top