D
Doc John
I created a non-rectangular Windows Form which opens inside of an MDI
container and I'm managing the MouseMove and MouseDown events with the
following code. The problem is that when I click on the mouse button so that
I can move the Form, the Form "jumps" about an inch to the bottom. This only
happens when the Form opens up inside an Mdi.
private Point mouse_offset;
private void Form1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
mouse_offset = new Point(-e.X, -e.Y);
}
private void Form1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
Location = mousePos;
}
}
Any help is appreciated. Thanks.
VS2005
container and I'm managing the MouseMove and MouseDown events with the
following code. The problem is that when I click on the mouse button so that
I can move the Form, the Form "jumps" about an inch to the bottom. This only
happens when the Form opens up inside an Mdi.
private Point mouse_offset;
private void Form1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
mouse_offset = new Point(-e.X, -e.Y);
}
private void Form1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
Location = mousePos;
}
}
Any help is appreciated. Thanks.
VS2005