[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?
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.
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?
Re: Checkbox.Text allowed characters?
Quote:
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.
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
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.
Re: Checkbox.Text allowed characters?
Awsome! Setting the UseMnemonic Property to False did the trick! Thanks!!!