New topic: Can't display "&" character in Label
<http://forums.realsoftware.com/viewtopic.php?t=46348> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message grechcj Post subject: Can't display "&" character in LabelPosted: Tue Dec 25, 2012 5:59 pm Joined: Sun Feb 14, 2010 11:19 pm Posts: 207 Location: Australia I can't display a sentence containing the "&" character in a label on Windows. eg. A&B displays AB In vb6 you had a property to allow mnemonics but I can't find mention of it in RS. Top grechcj Post subject: Re: Can't display "&" character in LabelPosted: Tue Dec 25, 2012 6:02 pm Joined: Sun Feb 14, 2010 11:19 pm Posts: 207 Location: Australia Just realized I can't display the same character in this forum. It shows as something different. I'm referring to the "and" abbreviation ie. chr(38) Top Markus Winter Post subject: Re: Can't display "&" character in LabelPosted: Tue Dec 25, 2012 6:36 pm Joined: Sun Feb 19, 2006 4:00 pm Posts: 1228 Location: Heidelberg, Germany It is a special character which is used to mark shortcuts on Windows. To show the character itself you need to escape it, eg have two of them one after the other. Top grechcj Post subject: Re: Can't display "&" character in LabelPosted: Wed Dec 26, 2012 2:37 am Joined: Sun Feb 14, 2010 11:19 pm Posts: 207 Location: Australia Okay I'll do that, Is there a way to extend the label class to automatically fix it ie. like vb6's .UseMnemonic property? I've got heaps of labels displaying text of every type. They are not a control array and I don't feel like putting the text through a function every time before display to test for "&". Top Markus Winter Post subject: Re: Can't display "&" character in LabelPosted: Wed Dec 26, 2012 3:28 am Joined: Sun Feb 19, 2006 4:00 pm Posts: 1228 Location: Heidelberg, Germany grechcj wrote:Okay I'll do that, Is there a way to extend the label class to automatically fix it ie. like vb6's .UseMnemonic property? I've got heaps of labels displaying text of every type. They are not a control array and I don't feel like putting the text through a function every time before display to test for "&". That's what .UseMnemonic does - it is just a function. You can do the same by making a label class with a constructor that modifies the caption accordingly. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
