private
Point mouse_offset;
private void Common_MouseUp( object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
((Control)sender).Location = ((Control)sender).Parent.PointToClient(mousePos);
}
}
private void Common_MouseDown( object sender, MouseEventArgs e)
{
mouse_offset = new Point( - e.X, - e.Y);
}
private void Common_MouseMove( object sender, MouseEventArgs e)
{
((Control)sender).Cursor = Cursors.Arrow;
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
((Control)sender).Location = ((Control)sender).Parent.PointToClient(mousePos);
}
}
private void Common_MouseUp( object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
((Control)sender).Location = ((Control)sender).Parent.PointToClient(mousePos);
}
}
private void Common_MouseDown( object sender, MouseEventArgs e)
{
mouse_offset = new Point( - e.X, - e.Y);
}
private void Common_MouseMove( object sender, MouseEventArgs e)
{
((Control)sender).Cursor = Cursors.Arrow;
if (e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
((Control)sender).Location = ((Control)sender).Parent.PointToClient(mousePos);
}
}