double click event handler for selected shape and shape added



I have learned how to loop through all the shapes!! There are two
things, I want to ask, which are currently the problems with me now in
visio development!!

1. How can write the double click event handler when a selected
shape. I can detect a double click by using mouse down code. But i
can't find out which shape is being clicked.

2. I wish to get the id, shape properties just as the shape is being
added to the document or page?

3. If any changes, occur in the properties of the shape, how can i
write an event handler for that?

Sorry, for posting similar messages on the group but I am really
stuck with this Visio development , although this isn't that hard. I
don't seem to find any good resource by googling which usually solves
my problem.

Need help( the deadline is getting closer)
Amir Diwan




For double-click on a shape, you could use EventDoubleClick cell on the shape
sheet of the shape. You would open shapesheet,and find Event section, and
EventDoubleClick cell. Put Shapesheet function there.
For example =RunMacro("MyMacro") would triger the macro .

I would like to recomend you study step by step Visio mechanism with the
material at .


I just saw the ShapeSheet Reference, and saw the EventDblClick
function. I dont see any code samples of c#, can u please link me to
something more specific?

I have no idea what macros are. If I try defining events in c#
without any code sample, that would be just beating around the bush!!

Amir Diwan


Or can u just give me some code sample urself, so i can optimize it
for my own use!!




David Parker


You need to know that individual shapes can have their double-click behavior
Most shapes in Visio open the text edit window when you double-click them,
but this can be changed to something else, or indeed to do nothing. This
is controlled by a formula in the EventDblClick cell.
It would seem that you are writing a Visio drawing control application, so
do you know what the shapes are supposed to do on double click?

If they are your masters/shapes, then cosider adding your own formula to the
EventDblClick cell, using QUEUEMARKEREVENT("/solution=MySolution /cmd=1") or
RUNADDONWARGS("QUEUEMARKEREVENT","/solution=MySolution /cmd=1") . You can
then listen for the MarkerEvent in C#. There are examples in the SDK.

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