C#窗体设计:[4]设置窗体位置
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、程序运行如下:
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:44
阅读量:89
阅读量:34
阅读量:66
阅读量:80