Questions

Creating a Login form using visual basic (in Visual Studio 2005 Profession)

Tags:
+
0 Votes
Locked

Creating a Login form using visual basic (in Visual Studio 2005 Profession)

z_nziramasanga
Would any1 be able to assist me with creating a login form using the above mentioned language. The password will be stored in SQL server any suggestions will be most appreciated.
  • +
    0 Votes
    Tony Hopkinson

    Create a new form

    Stick labels and textboxes on it to display login details.

    set the passwordchar property of the password textbox, so the password can't be seen as it's typed in. (* is the usual one)

    In the OK and Cancel buttons set the DialogResult property.

    In the form code define two public properties that read from and write to to the TextBox's texts properties.

    Then in your mainform
    add a login button, menu option ...

    in the click event

    frmLogin LoginForm;

    LoginForm = new frmLogin()
    LoginForm.UserName = DBUserName;
    if (LoginForm.ShowDialog == DialogResult.OK)
    {
    DBPassword = LoginForm.Password;
    }
    LoginForm.Close();

  • +
    0 Votes
    Tony Hopkinson

    Create a new form

    Stick labels and textboxes on it to display login details.

    set the passwordchar property of the password textbox, so the password can't be seen as it's typed in. (* is the usual one)

    In the OK and Cancel buttons set the DialogResult property.

    In the form code define two public properties that read from and write to to the TextBox's texts properties.

    Then in your mainform
    add a login button, menu option ...

    in the click event

    frmLogin LoginForm;

    LoginForm = new frmLogin()
    LoginForm.UserName = DBUserName;
    if (LoginForm.ShowDialog == DialogResult.OK)
    {
    DBPassword = LoginForm.Password;
    }
    LoginForm.Close();