1、新建一个C#应用程序,应用程序命名为WindowsForms。
2、界面设计如下,并设置窗体的StartPosition属性值僭轿魍儿为Manual,Location属性值为(200,200)
3、在添加新项中添加window窗体,将窗体命名为Form2
4、Form2界面设置如下:
5、对“打开新窗体”按钮添加响应函数button1_Cl坡纠课柩ick(),响应函数button1_Click()中添加一下代码:private void button1_Click(object sender, EventArgs e) { Form2 frm = new Form2(); frm.Location = new Point(400, 200); frm.StartPosition = FormStartPosition.Manual; frm.Show(); }
6、程序运行如下: