Link to home
Start Free TrialLog in
Avatar of tommychiu
tommychiuFlag for United States of America

asked on

return true false in C# window application

I have a login screen, license agreement screen, and main screen on my window application. I want the user click the accept button on the license agreement screen after login and then be able to see the main screen. Otherwise the application will shut down.

Can anyone tell me how to do that in C#?
Avatar of abel
abel
Flag of Netherlands image

inside your license form, under the Accept button click event (doubleclick the button to view the click event) you can add the following line:

this.Close();  // close the current form (you can also use this.Hide() instead)
under the Cancel (or Not Accept) button, you can put the following line:

Application.Exit();  // end the application
that should do the trick.

-- Abel --
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial