Visio shape context menu

B

BBD

Hi all,

Does anybody have good C# / VB.NET example (or knows link) WITH source code
to add items to right mouse click context menu (when clicked on shape in
Visio page) and handle event afterwards, when user selects the custom item
in this context menu? I know how to add a row to Actions rows of a shape
shapesheet:

short ActionSection = (short)(VisSectionIndices.visSectionAction);
TheShape.AddNamedRow(ActionSection, "SomeAction", 0);
Cell ActionCell = TheShape.get_Cells("Actions.SomeAction");
ActionCell.Formula = "Some action name";

When I right-click on the shape in Visio, then I see the context menu item
"Some action name", thats OK, but the question is: how can I handle the
event when user selects the menu item from custom menu? What is a C# code
for that?

Thanks,
BBD
 
A

Al Edlund

You might consider downloading the visio sdk. It has numerous examples on
event processing (marker events) and action menus.
al
 
D

David Parker

Further to Al's reply, you can make the action formula
=QUEUEMARKEREVENT("/solution=MySolution /cmd=n")
or
=RUNADDONWARGS("QUEUEMARKEREVENT","/solution=MySolution /cmd=n")

You can then use the HandleMarkerEvent code snippet to listen for your
particular action, etc
 

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