I have a login form that runs first. Upon successful login I want to close this form and open Frm_Main. As a beginner in C# I'm having a problem with OOP and simply closing a form without closing the entire app. I'm working in Visual Studio 2017.
To be more specific, I have Program.cs that launches Frm_Login. I am trying to check for a successful login and then if Globals.LoginSuccess == true close the Frm_Login so that Program.cs can then launch the Frm_Main. Inside my if Globals.LoginSuccess loop I direct to my 'Btn_Cancel_Click which has a 'this.Close()'. The Btn_Cancel_Click works as it should to close Frm_Login when I click on it directly. Perhaps my problem is calling my Btn_Cancel_Click.
Thanks.
To be more specific, I have Program.cs that launches Frm_Login. I am trying to check for a successful login and then if Globals.LoginSuccess == true close the Frm_Login so that Program.cs can then launch the Frm_Main. Inside my if Globals.LoginSuccess loop I direct to my 'Btn_Cancel_Click which has a 'this.Close()'. The Btn_Cancel_Click works as it should to close Frm_Login when I click on it directly. Perhaps my problem is calling my Btn_Cancel_Click.
Thanks.
Last edited: