how to cancel eventArgs
-
i have the following code this code runs on LogIn form Acts as standby while other forms still opened if(Application.OpenForms["MainForm"].MdiChildren.Length>0) { MessageBox.Show("!..you should close all opened windows before continue", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Application.Exit(); } when code running LogIn form disappeared and user can access any opened form i want to only keep LogIn form running untill entering valid password
-
i have the following code this code runs on LogIn form Acts as standby while other forms still opened if(Application.OpenForms["MainForm"].MdiChildren.Length>0) { MessageBox.Show("!..you should close all opened windows before continue", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Application.Exit(); } when code running LogIn form disappeared and user can access any opened form i want to only keep LogIn form running untill entering valid password
-
Dont use "Application.Exit();" It will kill all forms and end your application. Just close your MainForm and don't close your LoginForm.