Hi ,
I am having problems with mouse positioning and have code in the mouse up
and mouse down events using C# in VS 2005.
I am trying to draw a rectangle on top of a picture box image.
If I use the following code the box appears at the correct location but when
the screen is covered and redrawn the box is erased.
ControlPaint.DrawButton(System.Drawing.Graphics.Fr omHwnd(pictureBox1.Handle),
x3, y3, h1, w1,
ButtonState.Inactive);
If I create a button the button does not apppear at the correct location, it
seems to be positioned as per the form not the picture box.
Button ctrl = new Button();
this.Controls.Add(ctrl);
ctrl.SetBounds(pictureBox1. x3, y3, h1, w1);
I think I will need the button as later I want to have button click events.
-----
It also seems I cannot locate the picture box left and top position.
Any help would be useful.
Regards
Chris