笔记1
退出程序的方法用这个:
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
笔记2
使用组件拖动窗体
private int startX, startY;
private void button1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
startX = e.X;
startY = e.Y;
}
}
private void button1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Left += e.X - startX;
this.Top += e.Y - startY;
}
}
笔记3