How to make a login form in Visual Basics 2010

Picture of How to make a login form in Visual Basics 2010
Login Screen2.png
Login Screen3.png
In Visual Basics, have you ever wanted to make a login form?
Well then, I'll show you how!

Remove these adsRemove these ads by Signing Up

Step 1:

Picture of
Make a form and remove the text and change "Show Icon" to false.

Step 2:

Picture of
Add 2 lables, 2 textboxes, and 1 button.
Change label 1's text to "Username", and label 2's text to "Password", then the button's text to "Login".

Step 3:

Picture of
Double click the button, and put the following code in:
If TextBox1.Text = "username" And TextBox2.Text = "password" Then Form2.ShowDialog() Else MsgBox("Sorry, The Username or Password was wrong.", MsgBoxStyle.Critical, "Information") 
(Ignore the code in the image, i was tired and wrote the wrong code :P)

Step 4:

Picture of
Login Screen2.png
Login Screen3.png
Add a 2nd form, and voila!
You can also, to make it look more like a login, go to properties for the 2nd TextBox and then change the PasswordChar to '*'.
If it doesn't work, comment please :3
Nice instructable. You just helped me figure out what the line of code i was needing for my other project, so thanks.
farmerboyk (author)  hightekrednek23962 years ago
Your welcome:) I'm thinking about making a tut for a maze game i made. Maybe tomorrow... :3 its really fun :}
i made a game too did u use the tutorial from microsoft
farmerboyk (author)  hightekrednek23962 years ago
No, I actually haven't used any tutorials from microsoft, just a few videos(not on there site) on how to learn the language.

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!