[Mono-winforms-list] Mouse position question

Jonathan Pobst monkey at jpobst.com
Mon Dec 21 10:52:29 EST 2009


On 12/21/2009 9:35 AM, Paul wrote:
> Hi,
>
>> I m not sure to completely understand your question, but did you look
>> at screen bound ?
>> yu should know, the position of the form on the screen and it size
>> ....
>
> I have a form with an image as a background image. It has a size of
> 800x600. If I click in the middle of the image, it returns x = 400, y =
> 300 which is fine. If I resize to 400 x 300, the middle becomes x = 200,
> y = 150.

I think it's something like:

x = (800 * e.X) / Form.Bounds.Width;
y = (600 * e.Y) / Form.Bounds.Height;

Jonathan


More information about the Mono-winforms-list mailing list