0% found this document useful (0 votes)
5 views1 page

Log-In Form

The document is a Visual Basic code for a login form that includes functionality to show or hide the password. It checks for a specific username and password combination, displaying a success message and transitioning to another form upon successful login. Additionally, it provides a cancel button to close the application.

Uploaded by

tsowasebtrevor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Log-In Form

The document is a Visual Basic code for a login form that includes functionality to show or hide the password. It checks for a specific username and password combination, displaying a success message and transitioning to another form upon successful login. Additionally, it provides a cancel button to close the application.

Uploaded by

tsowasebtrevor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

' show/hide password text

Private Sub CheckBoxSP_CheckedChanged(sender As Object, e As EventArgs)


Handles CheckBoxSP.CheckedChanged

If txtPassword.UseSystemPasswordChar = True Then

'show password
txtPassword.UseSystemPasswordChar = False

Else

'hide password
txtPassword.UseSystemPasswordChar = True

End If
End Sub

Private Sub ButtonLogin_Click(sender As Object, e As EventArgs) Handles


btnLogin.Click
If txtUsername.Text = "abcd" And txtPassword.Text = "123" Then
MsgBox("You login successfully")
txtUsername.Text = ""
txtPassword.Text = ""
Form2.Show()
Me.Hide()
Else
MsgBox("Wrong username or password")
txtUsername.Text = ""
txtPassword.Text = ""
End If

End Sub

Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs)


Handles btnCancel.Click
Me.Close()
End Sub
End Class

You might also like