Working with Visio 2003 Page & Shape context (popup) menus in C#

D

dinesh

we are using Visio 2003 as a drawing control in a C# project and are able to
manipulate or use various Visio built-in menus but cannot change the context
(right-click popup) menu for a drawing page or shape. How do we access this
menu and remove some of its menu items and add our own menu items. Not able
to determine what menu it is and when we can access it (before displaying).
Any VBA sample code would also be helpful.
 
A

Al Edlund

You face two issues if my memory is correct. a.) vba code in a document is
not accessible when the document is accessed via a drawing control. So you'll
have to write your code in c#. b.) the context menu's can be altered if you
don't want everything that is there (as I remember if you take over the right
mouse click event) then you get to write your own dialogs.
al
 
D

dinesh

Hi Al

thanks for the reply , i was able to disable the right click menu with your
code,
but i was unable to add the contextmenustrip to the visio can u help me out
with this, if possible a piece of code.

actually i want to add an item to that menu or we can create a new menu in
place.

thanks

dinesh
 
A

Al Edlund

The next step is to use a marker event (via addadvise) to call your routine.
There are examples of how you might create it in the visio sdk.
al
 
D

dinesh

i

can u provide me full code , still i am not able to display the menu,

my problem is i have to add a menuitem on the menu which is displayed when
the user right clicks on the shape which he has drawn on the visio sheets.

i would be highly thankful to u , if u could provide me the whole code or
mail me.
(e-mail address removed)


thanks

dinesh
 
A

Al Edlund

unfortunately, I don't write in any of the c versions (c, c#, c++). There are
examples of how to add action items to a shape and add event handlers for
marker events in the sdk.
al
 

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