如何用C#的location属性移动窗口?
就是一个窗体,按下一个按钮可以左移窗口2像素,按下另外一个,右移窗口2像素。怎么编写代码?用location属性。
private void button1_Click(object sender, EventArgs e)
{
int x = this.Location.X;
int y = this.Location.Y;
this.Location = new Point(x + 2, y);
}