private bool isMouseDown = false;
private Point FormLocation; //form的location
private Point mouseOffset; //鼠標的按下位置
private void Messages_MouseDown(object sender
{
try
{
if (e
{
isMouseDown = true;
FormLocation = this
mouseOffset = Control
}
}
catch (Exception)
{
}
}
private void Messages_MouseMove(object sender
{
try
{
int _x =
int _y =
if (isMouseDown)
{
Point pt = Control
_x = mouseOffset
_y = mouseOffset
this
}
}
catch (Exception )
{
}
}
private void Messages_MouseUp(object sender
{
try
{
isMouseDown = false;
}
catch (Exception)
{
From:http://tw.wingwit.com/Article/program/net/201311/13175.html