get Id properties of selected shape

W

weird0

I am able to detect double clcik in my visio application but how can
i find out that which shape being currently selected in the
currentPage or application.

Amir Diwan
Regards
 
J

JuneTheSecond

Debug.Print ActiveWindow.Selection(1).ID
writes Id of selected shape.
Application.DoCmd visCmdFormatSpecial
displays a dialog and ID is written.
 
W

weird0

I tried out the line of code that you gave me, but it aint working
for me!! I declared a string variable just before the mouse down
event and upon double click, i wanted to display the id of the shape
that is just selected( or the shape that is double-clicked). But that
does not seem to work for me.

Is there any other way, i can detect double click being done on a
shape, and open my personalized window?????
And how do i program, the ShapeAdded event? I want is that when a
shape is added i can write my own code. Not able to write the
Document_ShapeAdded event..!! Need help!! here is the code


private void axDrawingControl1_MouseDownEvent(object
sender,AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseDownEvent e)
{
string ID1 =
application.ActiveWindow.Selection[1].ID.ToString();

if (0!=m_previousMouseDownEvent &&
(System.Environment.TickCount-m_previousMouseDownEvent)<threshold)

{

// Two MouseDown events occurred within
threshold milliseconds
// of each other... Consider it a "double
click"...

MessageBox.Show("Id1:" + ID1.ToString());
//System.Windows.Forms.MessageBox.Show("Double
clicked!");

}

m_previousMouseDownEvent =
System.Environment.TickCount;

}
 
J

JuneTheSecond

In the case of Drawing Control, you wolud try about
string ID1 =
axDrawingControl1.Document.Application.ActiveWindow.Selection[1].ID.ToString();
 

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