|
-
Jun 15th, 2002, 08:52 AM
#1
Thread Starter
New Member
Unmasking a string
i have a masked word in a text box. i aslo have an array of 26 command buttons, with a letter of the alphabet on each of the buttons. i want to know how i could unmask a letter in the word in the txtbox if i click on one of the cmdLetters.
-
Jun 15th, 2002, 09:22 AM
#2
-
Jun 15th, 2002, 09:25 AM
#3
Hyperactive Member
You mean like a hang-man type game?
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jun 15th, 2002, 09:44 AM
#4
Thread Starter
New Member
re:
ye kinda like hang man.
in the form i have a text box. 26 command buttons (array 0 to 25). each of the command buttons have a letter of the alphabet on it. so it looks like i have a keyboard on the form.
in the text box, there is a "word" and it is masked to look like "****".
i want to know how i could make the "****" back to "word" when i click on the "w" "o" "r" "d" command buttons. so i need to know some sort of code where i could un-mask the "****" in the text box. you know what i mean?
-
Jun 15th, 2002, 09:49 AM
#5
-
Jun 15th, 2002, 10:03 AM
#6
Thread Starter
New Member
re:
i actually dont have any labels. the word itself is a string inside a textbox.
-
Jun 15th, 2002, 10:07 AM
#7
-
Jun 15th, 2002, 10:13 AM
#8
Thread Starter
New Member
re:
thanks..could you possibly give me an example of how i could do that? ive tried it and im doing it wrong...
-
Jun 15th, 2002, 10:17 AM
#9
-
Jun 15th, 2002, 10:33 AM
#10
Thread Starter
New Member
ive erased it, but it went something like -
dim MyWord as string
dim LetterPosition as integer
Mid$(MyWord, LetterPosition, 1) = Chr(index + 65)
'all this is under the cmdLetter_click
-
Jun 15th, 2002, 10:41 AM
#11
Need-a-life Member
Try this:
VB Code:
Private Sub cmdLetter_click(Index As Integer)
Dim MyWord As String
Dim LetterPosition As Integer
For LetterPosition = 1 To Len(WordToGuess)
If Mid$(WordToGuess, LetterPosition, 1) = Chr$(index + 65) Then
Mid$(MyWord, LetterPosition, 1) = Chr(index + 65)
End If
Next LetterPosition
End Sub
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Jun 15th, 2002, 11:00 AM
#12
Thread Starter
New Member
nope...doesnt seem to want to do anything..
-
Jun 15th, 2002, 11:04 AM
#13
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|