Hangman
Hangman
Hangman
Hangman
Hangman
Hangman Hangman Hangman Hangman Hangman Hangman Hangman Hangman
Hangman Hangman
Hangman
Go Back  Xtreme Visual Basic Talk > > > Hangman


Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2010, 11:30 AM
VBGibby VBGibby is offline
Newcomer
 
Join Date: Jan 2010
Posts: 8
Default Hangman


Hey guys, I've got to make a hangman game for class. One of the requirements is to display a text box for each letter in the selected word and i have no idea how to do that. Can anyone help?
Reply With Quote
  #2  
Old 04-29-2010, 10:34 PM
vb5prgrmrHangman vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,087
Default

Put a textbox on your form and set its index property to zero (0). (No index, not using vb6.0) After that, you can use the len function to return the number of characters in the word and if the word is a phrase, you can use the mid function to test for spaces. So what you would do is to run from 1 to len(theword) and test if mid(theword, cnt, 1) = " " then you would not create a new text box, if it it was <> " " then you would load text1(cnt), set its left and top properties and make it visible = true.



Good Luck
__________________
Just because I'm an expert does not mean I know it all and just because I know it all does not mean I'm an expert
Reply With Quote
  #3  
Old 05-05-2010, 05:31 AM
DreamingInCode DreamingInCode is offline
Newcomer
 
Join Date: Apr 2010
Posts: 4
Default

Yeah, we had the same task the other day, I did the same as what vb5prgmr did and used a len(wordname) function to return a value for the number of text boxes, and then if you had an array of text boxes, you could change the visible propery of the number of letters in relation to the number of boxes, eg. six letters = six visible boxes. I hope this helps, I remeber having a fair bit of trouble with it
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Hangman
Hangman
Hangman Hangman
Hangman
Hangman
Hangman Hangman Hangman Hangman Hangman Hangman Hangman
Hangman
Hangman
 
Hangman
Hangman
 
-->