
03-30-2012, 11:27 AM
|
 |
Fabulous Florist
Forum Leader * Guru *
|
|
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,419
|
|
There are an unenumerable amount of examples of answers to this question on this forum and others. The particulars of how each step is implemented are different for every application, but in the end it boils down to this:
Make a login form. Either make that your startup form, or have your main form display it modally. When the user clicks whatever button is the "OK" button, execute something like this:
Code:
If (AreCredentialsValid(username, password)) Then
MaybeSaveUserInformation()
ShowMainForm()
CloseThisForm()
Else
DisplayErrorMessage()
EndIf
It's up to you to implement the individual steps there. The only snag is, depending on how "CloseThisForm()" is implemented, you might have to change your project settings to close the program when the last form is closed, not the startup form.
|
|