【发布时间】:2012-04-24 23:55:20
【问题描述】:
我有一个以登录屏幕启动的 Winforms 应用程序。如果用户的登录凭据良好,则调用此方法:
public void success()
{
mainForm index = new mainForm();
index.Show();
this.Close();
}
我以为这会打开mainForm 并关闭登录表单,但是当我运行它时,它会关闭整个应用程序。这是为什么?总的来说,我对 C# 和 OOP 还很陌生,因此欢迎提供任何提示!
我尝试做这样的事情: Closing a form and then call another one
但我仍然得到相同的结果。
谢谢:)
【问题讨论】: