用C#编码 [英] coding in c#

查看:99
本文介绍了用C#编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

f 的代码是什么,或者在Visual C#中关闭Windows应用程序窗体.

What is the code for closing a Windows Application form in Visual C#.

推荐答案

如果您要关闭自己的应用程序:

If you want to close your own application:

Application.Exit();



如果要关闭表单:



If you want to close a form:

Form frm = new Form1();
frm.Show(); //Shows the form
frm.Close(); //Closes the form



您究竟需要什么?



What exactly do you need?


Form1 form1= new  Form1();
form1.Close();



Form1是要关闭当前表单中的另一个表单的表单类.



Form1 is the form class which you want to close if you want to close another form from current form.

this.Close();


如果要关闭当前表单.


If you want to close current form.

Application.Exit();


关闭应用程序.


To close application.


这篇关于用C#编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆