Hangman Tutorial - Page 1 - Visual Basic .NET
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
This tutorial will show you how to make a Hangman game in visual basic 2010. Before I go on in this tutorial here are some snap shots of the final game:
Open Visual Basic 2010 or 2008 and click on New Project (File - New Project)
Choose Windows Forms Application, then name your project "Hangman" then click OK
Right click on your the form then click on "Properties"
The properties window will appear (on the right side by default)
Change the following properties of the created form:
BackColor: 0, 192, 0
Size: 440, 550
*If you noticed above that I have disabled minimize, maximize and resize properties; and that is because if you resize the form and there is graphics painted on the it, it will be erased.
Now your form should look like this:
Add a Button to your form (Open Toolbox on the left side, or
click on Ctrl+Alt+X if you don't see it, then drag a button to the
Change its text to "Play", its font to 18 ponits, its name to PlayButton and resize it to look similar to the following image:
Now add from 6 Labels from Toolbox to the form:
Change their font properties to 18 points, and their name to Letter1, Letter2, Letter3, etc..., their text to A and place them on the form like the following image:
Now add a Button to the form. This button will be used as the letters underline, so change the following properties of the button:
Size: 48, 2
Now make 5 copies of the button you just created and place them on the form like the following image:
Change the buttons' name properties to Line1, Line2, Line3, etc...
Now add a label to the bottom of the form and change its text to Wrong Guesses