out of boredom I've made a basic loginform for anyone to use here's the zip file containing the form, feel free to use & modify it freely ... you dont even need to tell me about it
here's basically how it works
you make an instance of it then you can set the properties UserId, Password, UserIdMaxLength and PasswordMaxLength then just call the the ShowDialog method
or I've provided some other ShowDialog signatures that allows those properties to be set with only 1 ShowDialog call
also when the Login button is clicked on the window you can retrieve the UserID and Password from their respective properties
also this works with the DialogResult object as well so you can easily check to see if the cancel button was clicked or not
here's a quick example on how to use the LoginForm:
*Edit 9-21-2005* Fixed a few things, also included a Demo Project
here's basically how it works
you make an instance of it then you can set the properties UserId, Password, UserIdMaxLength and PasswordMaxLength then just call the the ShowDialog method
or I've provided some other ShowDialog signatures that allows those properties to be set with only 1 ShowDialog call
also when the Login button is clicked on the window you can retrieve the UserID and Password from their respective properties
also this works with the DialogResult object as well so you can easily check to see if the cancel button was clicked or not
here's a quick example on how to use the LoginForm:
VB.NET:
Dim strPassword As String
Dim strUserName As String
Dim Login As New frmLogin
With Login
.UserIDMaxLength = 12
.PasswordMaxLength = 12
.UserID = "Bob"
If .ShowDialog("Test App 1") <> DialogResult.Cancel Then
strUserName = .UserID
strPassword = .Password
End If
End With
*Edit 9-21-2005* Fixed a few things, also included a Demo Project
Last edited: