-
Jan 25th, 2013, 01:23 PM
#1
Thread Starter
Lively Member
[RESOLVED] Checkbox.Text allowed characters?
Where can I find a list of allowed characters that can be displayed in the checkbox.text area. For instance, when the user enters "&" as part of the text for a checkbox, the "&" does not get displayed. So I want to filter these non-printing characters out of the string entered. Is there a list? Or, am I taking the wrong approach?
Thanks,
David
How much deeper would the ocean be if sponges didn't grow there?
-
Jan 25th, 2013, 01:36 PM
#2
Addicted Member
Re: Checkbox.Text allowed characters?
Are you talking about a textbox? As you do not enter text into a checkbox.
As for the sponge question, it would be shallower, because they would not be there to displace water.
...
If someone helps you, show it by rating their post!
VB.net Code:
' These two lines will make your coding life much easier!
Option Explicit On
Option Strict On
"Check everything. That's what software developers do." jmcilhinney
-
Jan 25th, 2013, 01:45 PM
#3
Thread Starter
Lively Member
Re: Checkbox.Text allowed characters?
No, it is actually a checkbox. My program allows users to add new catagories which items can belong to. When a new catagory is added, I prompt the user in another form for the description of the new catagory. I then add a new checkbox control to the form and set its .text property to the string value entered by the user. The problem I am having is when a character is entered such as "&", it is displayed in the textbox where it is type, however, when I place that same text in the checkbox.text propery the "&" is replaced with "_". For instance, if the user enters "Bob & Dave" the checkbox label shows up as something like "Bob _Dave".
Any help?
Thanks,
David
How much deeper would the ocean be if sponges didn't grow there?
-
Jan 25th, 2013, 01:55 PM
#4
Re: Checkbox.Text allowed characters?
Originally Posted by DFarris
No, it is actually a checkbox. My program allows users to add new catagories which items can belong to. When a new catagory is added, I prompt the user in another form for the description of the new catagory. I then add a new checkbox control to the form and set its .text property to the string value entered by the user. The problem I am having is when a character is entered such as "&", it is displayed in the textbox where it is type, however, when I place that same text in the checkbox.text propery the "&" is replaced with "_". For instance, if the user enters "Bob & Dave" the checkbox label shows up as something like "Bob _Dave".
Any help?
Set the checkbox control UseMnemonic Property to False.
-
Jan 25th, 2013, 01:59 PM
#5
Hyperactive Member
Re: Checkbox.Text allowed characters?
It is a little weird, but if you double the character, it removed the special functions, EG && litterally puts a ampersand in the text
There is Edges idea if you don't want to use Mnemonic at all
-
Jan 25th, 2013, 02:00 PM
#6
Re: Checkbox.Text allowed characters?
As Edgemeal's answer suggests it's not that the character is disallowed, it's that it's understood to be a HotKey (Alt + ) indicator as in all controls.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 25th, 2013, 02:06 PM
#7
Thread Starter
Lively Member
Re: Checkbox.Text allowed characters?
Awsome! Setting the UseMnemonic Property to False did the trick! Thanks!!!
Thanks,
David
How much deeper would the ocean be if sponges didn't grow there?
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
|