[RESOLVED] Is it possible to hide some letters inside a label caption, but not all of them?
Hi there folks! I am working on a "figure out the missing word" game for Kindergarten students. What I would like to do is have a word in a label caption (and I have that) The words could be anywhere from 2 letters long to 8 letters. What I am trying to figure out is how to replace random letters in the caption with blank spaces or underscores, leaving only 1 letter showing.
I've used replace in the past, but only when replacing 1 specific characters with another specific character.
Re: Is it possible to hide some letters inside a label caption, but not all of them?
I'd suggest using a separate string variable, modifying it as needed, then reassign that variable to the label's Caption property. You can change an individual letter in a string variable using Mid$(), i.e., change the 5th character to an underscore:
Code:
Mid$(strCaption, 5, 1) = "_"
Insomnia is just a byproduct of, "It can't be done"
Re: Is it possible to hide some letters inside a label caption, but not all of them?
An alternative to a label is to use an array of textboxes.
See the attached example where once you 'load' the word (I only load one: "TEACHER"), you click on any of the textboxes to show the first letter...then if the student doesn't guess correctly, click on another one...until the answer is completely shown.
Re: Is it possible to hide some letters inside a label caption, but not all of them?
If you want to leave only one character visible and still remember the original you can simply set the caption to all underscores or whatever character you want to use.
You have your real string stored in a variable or if you want the tag of the label.
You would then use a combination of Rnd() and Len() to get a random character from your string and the Mid$ statement to place that character into the correct position of the label leaving all the others as underscores.
Re: Is it possible to hide some letters inside a label caption, but not all of them?
Morning, Justin...
Just for fun, I made a 'few' changes to the program I attached yesterday. Let's you show a form to the kids while you work on the main form, selecting the words (you'd need a second monitor to display the second form).
Anyway, it uses an array of textboxes, randomize (non-repeating random numbers) and a second form.
→ The Comprehensive Guide to Cloud Computing
A complete overview of Cloud Computing focused on what you need to know, from selecting a platform to choosing a cloud vendor.