Setting which form loads first

mechano

Newcomer
Joined
Dec 9, 2004
Messages
1
Location
Cape Town, South Africa
I have the following problem :
I have 2 Forms : 1. login.cs and 2. mainForm.cs

mainForm.cs is my main app and login.cs should block access to mainForm.cs. I use a SQL db on login.cs to authenticate. What I would like to know is how I would temporarily disable mainForm.cs while the user is logging in with login.cs

Any help would be greatly appreciated
 
Could you not load the login form 1st, and if the correct credentials are entered then load the main form? Or failing that display the login form with .ShowDialog to prevent access to the main form.
 
I do the same thing at work.

The way I did it was do to as PlausiblyDamp suggests, I set the Login form as the 1st one loaded and after they have logged in hide the login form and do a showdialog for the main menu, when that one closes the login form then closes.

Code:
this.Hide();
MainMenu LoadMenu = new MainMenu();
LoadMenu.ShowDialog();
this.Close();
 
Back
Top