hi, i need some help with my hangman game. i have the whole thing down except i don't know how to get it to draw the head if the first letter is wrong, the body if the second, etc. i'm really new at visual basic and i could really use some help in easy terms!

thank you!

Recommended Answers

All 4 Replies

In the most simplistic way, you can use the shape control for the head and line controls for the rest of the body. Stepping up from that you can use a picture box control to draw in via line and circle. Then from there you could use a predifined image and copy parts of it via BitBlt API and its friends. After that it gets even more complicated.

Good Luck

i have no idea what any of that means lol but thank you for taking the time to try to help

Okay, in you Visual Basic 6.0 IDE (Integrated Design Environment) you have a toolbox. Usually located on the left side of the screen. It is where you find textbox controls, comboboxes, commandbuttons, and so on. Well by default, in VB6, with a standard exe project, there are other controls than those listed above. One of them is a shape control. which is capable of drawing on your form various simplistic shapes (rectangle, square, oval, circle, rounded rectangle, rounded square). Then, located next/near to that control is the line control.

Now, with these controls, you can use the shape for the head, and the line controls for the torso, arms, and legs. All you need to do is to place them on the form where you want them. Make them visible = false at the start and as the user makes incorrect guesses you just make each control visible = true.

Also, you can use the line controls to make the gallows if you want.

Good Luck

Most people asking about the hangman are using Excel. Attached is my version of Hangman.xls

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.