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

Simple VB.NET Login Form Example

This code defines a login form with two buttons. When the login button is clicked, it checks if the entered username and password match the hardcoded values. If they match, it opens a new form and shows a success message, otherwise it shows an error message. The second button closes the form when clicked.
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)
10 views1 page

Simple VB.NET Login Form Example

This code defines a login form with two buttons. When the login button is clicked, it checks if the entered username and password match the hardcoded values. If they match, it opens a new form and shows a success message, otherwise it shows an error message. The second button closes the form when clicked.
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

Public Class Form1

Private Sub Button1_Click(ByVal sender As Object, e As EventArgs) Handles [Link]


Dim username As String
Dim Password As String
username = [Link]
Password = [Link]

If [Link]("admin") And [Link]("123") Then


[Link]("Login Success", "Information", [Link], [Link])
[Link]()
Else
[Link]("Error", "Information", [Link], [Link])
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


Close()
End Sub
End Class

You might also like