程序.cs
using (Login login = new Login())
{
login.ShowDialog(); //Close this form after login is correct in login form button_click
}
if (isValiduser == true) //Static variable created in application to check user
{
Application.Run(new MainInterface());
}
登录表单点击事件
private void btnLogin_Click(object sender, EventArgs e)
{
if(isValiduser == true)
{
this.Close();
}
else
{
//else part code
}
}
根据此代码,当我们在登录表单中单击登录事件并且 isValiduser 返回 true 时,Program.cs 将运行MainInterface
表单。但实际上,这段代码没有运行Application.Run(new MainInterface())
;那么,谁能告诉我这段代码有什么问题?