Home All Groups Group Topic Archive Search About

Check if Mousepointer is over a region

Author
20 Nov 2007 11:03 AM
Stefan Uhlemann
Hi,

how can i check if the mousepointer is over a System.Drawing.Region (from
graphicspath).
In vb6 i used the API Call "PtInRegion" - Is ther something like that in VB
2005??

btw:
The region is not a rectangle.

Thanks

Stefan

Author
20 Nov 2007 12:10 PM
Armin Zingler
"Stefan Uhlemann" <ste***@myxperience.de> schrieb
> Hi,
>
> how can i check if the mousepointer is over a System.Drawing.Region
> (from graphicspath).
> In vb6 i used the API Call "PtInRegion" - Is ther something like
> that in VB 2005??
>
> btw:
> The region is not a rectangle.

Untested: Try the Region's IsVisible function.

Depending on the coordinate system, you may have to use the Control's
PointToClient/PointToScreen methods additionally, and you have to take the
offset of the Control's origin and the Region's origin into account (if not
equal)


Armin
Author
20 Nov 2007 3:23 PM
rowe_newsgroups
Show quote Hide quote
On Nov 20, 6:03 am, "Stefan Uhlemann" <ste***@myxperience.de> wrote:
> Hi,
>
> how can i check if the mousepointer is over a System.Drawing.Region (from
> graphicspath).
> In vb6 i used the API Call "PtInRegion" - Is ther something like that in VB
> 2005??
>
> btw:
> The region is not a rectangle.
>
> Thanks
>
> Stefan

If all else fails, you should still be able to use the API call you
used in VB classic.

http://www.pinvoke.net/default.aspx/gdi32/PtInRegion.html

That declaration is for C#, but you should be able to convert it.

Thanks,

Seth Rowe