close an windows app
Posted on 2011-03-25
to start , i am pretty new at the c# windows app world
when my app starts in the constructor of the form1 i check to see if two variables are populated)
(uname and password)
the problem i am having is if the user closes the login form or cancels i need the app to go away
i thought in the else of the dialogresult i could do
but that does not work.
looks for suggestions on the best way to do this?
if (username == null || passwd == null)
DialogResult dr = new DialogResult();
LoginForm login = new LoginForm();
dr = login.ShowDialog();
if (dr == DialogResult.OK)