Get/Select mouse pointed shape

M

Mishaev Mark

Hi,

I'm using Visio ActiveX control in my application.

I need to find a way to get/select the shape that mouse is over on.

I know that I should use mouse up or down events to know the current
coordinates, but I do not know is how can I know that shapes which are under
it.


Thanks a lot,

Mark.
 
C

Chris [Visio MVP]

Check out the SpatialSearch property. It allows you to ask Visio; "What
shapes are under this point, (x, y)?"

You'll have to convert the mouse x-y coordinates to Visio page coordinates.
There's examples of this in the Visio SDK.

http://www.microsoft.com/downloads/...bd-b0bb-46e7-936a-b8539898d44d&displaylang=en

Check the ActiveX control sample for examples of converting mouse to page
coordinates.

The mouse coordinates are in Window coordinates, and Visio objects use Page
coordinates. See Page.GetViewRect and Page.GetWindowRect to do these
conversions.
 
Top