realbasic-nug
[Top] [All Lists]

Re: StaticText and '&'

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: StaticText and '&'
From: Charles Yeomans <charles at declareSub dot com>
Date: Fri, 30 Sep 2005 18:39:34 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <266C7B6A-943C-4AC8-A1E9-67BECD9AC344 at graymattercomputing dot com>

On Sep 30, 2005, at 6:29 PM, David Glass wrote:

In an effort to properly display ampersands in StaticText captions I was wondering if it would be possible to subclass the StaticText control to handle the caption manipulation.

Would this be an effective way of handling the issue, or am I better off with a bunch of 'replaceall(text, "&", "&&")' commands?

Ideally, a subclass is workable as I would like to then subclass popupmenus as well.

Any guidance on how to accomplish this would be appreciated.

Instead of subclassing, use Extends and a global method to add a method to StaticText.

Sub SetEscapedText(Extends s as StaticText, theText as String)
  s.Text = ReplaceAll(theText, "&", "&&")
End Sub



--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>