I have a form that I want to provide some security on, but up to this point I’ve only created one form that does all of my work. I want to create a new form that pops up in front of my main form right when the application launches. Then validates the password entered against a MySQL database. I have all of the MySQL stuff down, but wondering how to make another form pop up in front of my main form which disables the main form, waits for the password form to validate, then disappears once the form is validated and lets the user perform their work. I’ll also need to transfer the authenticated user’s info back to my main form.
Share
You can create a new form and then use the ShowDialog function. If you show the form from your main form it will be displayed in a modal fashion.
Create this in a login style and close the form if the user is authenticated or show an error if the username and password are incorrect.
From MSDN: