关闭窗口而不出境申请 [英] Close form without exit application

查看:123
本文介绍了关闭窗口而不出境申请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个小项目,希望它的一些帮助。

I'm currently working on a small project and would like some help on it.

我有2种形式,第一种是登录窗口,第二个会是主程序。我的问题是,当我关闭 Form1中 this.Close()是退出整个程序。

I have 2 forms, the first is a login window and the second will be the main program. The problem I have is that when I close form1 with this.Close() it is exiting the whole program.

我有一种感觉,我需要使用线程或者类似的东西,但我无法找到要解决我的问题,正确的资源。

I have a feeling that I need to use threading or something like that but I can't find the right resource for my problem to be solved.

感谢

推荐答案

您可以隐藏第一种形式,而不是将其关闭:

You could hide the first form instead of closing it:

this.Hide();
Form2 form2 = new Form2();
form2.Show();

这篇关于关闭窗口而不出境申请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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