Y-Axis problem

M

Mark

Hi Everyone:
I'm playing around with a GDI+ application using VB.NET. I have written a
small Windows application that will allow me to place a rectangle at the
screen's origin (top-left corner of the screen). After the rectangle is
placed I can point to it with my mouse and by holding down the left button
move the selected rectangle elsewhere on the screen.

This only works when the Y-Axis' location is at the top-left hand corner. I
used a matrix transformation to reset the Y-Axis' origin to the bottom left
hand corner. This time when I draw a rectangle it is placed at the
bottom-left hand corner, but when I place my mouse on the rectangle located
at the bottom-left hand side it will not highlight saying this rectangle has
been selected.

The strange thing is: If I move the mouse back to the top-left corner where
the default origin is the rectangle at the botton-left corner will highlight
and when I press the left mouse button and move the mouse down the selected
rectangle moves up. This is not how I want it to work. I have the project if
anyone needs it to see exactly want is happening.
 
M

Mark

Patrice:
Do you know how to do this? The Graphics Transformations apply only to
graphical objects. The screen Coordinates are part of the
System.Windows.Forms.MouseEventArgs class.

Here is my hittest code:
Public Overridable Function HitTest(ByVal p As Point) As Boolean
'Default behavior
Return New Rectangle(_location, _size).Contains(p)
End Function
 

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