windows无边框窗体移动设置
int cx; int cy;
private void btnClose_Click(object sender, EventArgs e)
{ this.Close(); }
private void btnClose_MouseLeave(object sender, EventArgs e)
{ btnClose.BackColor = Color.Transparent; }
private void btnClose_MouseMove(object sender, MouseEventArgs e)
{ btnClose.BackColor = Color.Red; }
private void panel1_MouseDown(object sender, MouseEventArgs e)
{ if (e.Button == MouseButtons.Left)
{ cx = e.X;
cy = e.Y;
}
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{ if (e.Button == MouseButtons.Left)
{ this.Left += e.X - cx;
this.Top += e.Y - cy;
}
}
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。