Results 1 to 1 of 1

Thread: VS2005/2008 Login Form

Threaded View

  1. #1

    Thread Starter
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    VS2005/2008 Login Form

    I've made a basic loginform in VS 2005 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

    How it works:
    Make an instance of it then you can set the properties UserId, Password, UserIdMaxLength and PasswordMaxLength then just call the the ShowDialog method
    I've provided some other ShowDialog signatures that allows those properties to be set with only 1 ShowDialog call

    When the Login button is clicked on the window you can retrieve the UserID and Password from their respective properties

    This works with the DialogResult object as well so you can easily check to see if the cancel button was clicked or not

    Properties to pay attention to:
    *Title - Shows in the window's caption bar
    *UserID - Default value for the UserID textbox
    *Password - Default value for the Password textbox
    *UserIDMaxLength - The max chars for UserID
    *PasswordMaxLength - The max chars for Password
    *AllowUserIDNull - Allow the UserID to be blank? Default is False.
    *AllowPasswordNull - Allow the UPassword to be blank? Default is False.

    Here's a quick example on how to use the LoginForm:
    Code:
    Dim UserID, Password As String
    
    m_Login = New LoginForm
    With m_Login
        .Owner = Me
        .UserIDMaxLength = 16I 'Limit number of chars
        .PasswordMaxLength = 16I
        .AllowPasswordNull = True
        If .ShowDialog("Login to the system", "Neo") = Windows.Forms.DialogResult.OK Then
            'Use properties to get info back:
            UserID = .UserID
            Password = .Password
            MessageBox.Show("Possible success!")
        Else
            MessageBox.Show("Canceled!")
        End If
    End With
    Attached Files Attached Files
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width