Hangman Tutorial - Page 1 - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

Page 1

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:

Visual Basic 2010 Hangman

Hangman Game in Visual Basic 2010

How to make Hangman in Visual Basic 2010

Open Visual Basic 2010 or 2008 and click on New Project (File - New Project)

Visual Basic New Project
Choose Windows Forms Application, then name your project "Hangman" then click OK

Visual Basic Windows Forms Application

Right click on your the form then click on "Properties"
The properties window will appear (on the right side by default)
Visual Basic Properties Window

Change the following properties of the created form:
BackColor:  0, 192, 0
FormBorderStyle: FixedSingle
MinimizeBox: False
MaximiseBox: False
ShowIcon: False
Size: 440, 550
Text: Hangman

*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:
Visual Basic programming hangman game

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 form).
Change its text to "Play", its font to 18 ponits, its name to PlayButton and resize it to look similar to the following image:
Play Button for Hangman game

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:

Label Controls for Hangman Game

Now add a Button to the form. This button will be used as the letters underline, so change the following properties of the button:

Enabled: False
FlatStyle: Flat
Size: 48, 2

Now make 5 copies of the button you just created and place them on the form like the following image:

Designing Hangman game in VB 2010

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

Hangman Form designed in visual basic .net

Pages: 1 2 3

Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2018 - All Rights Reserved.