On 03/04/2013 14:13, The Finder wrote:
> On Tuesday, April 2, 2013 8:00:44 PM UTC-5, Eduardo wrote:
>> The 'Replace$' is a VB6 function, not something to tell you that
>> the user must manually replace the text. Somewhere in your code you
>> must have something like:
>> Private sub List1_Click()
>> Label1.Caption = List1.List(List1.ListIndex)
>> End Sub
>> just change that to
>> Private sub List1_Click()
>> Label1.Caption = Replace$ (List1.List(List1.ListIndex), "&", "&&")
>> End Sub
> --------------------------------------------------------------------------------
>
> Thanks Eduardo, it's really a nice thing to learn something new in a
> field that one is very interested in, I didn't know about the
> "Replace$" function and I've played with that too the only difference
> is I changed the ending to look like List1_Click() Label1.Caption =
> Replace$ (List1.List(List1.ListIndex), "&", "&"
That does nothing at all, it just leaves the & characters unescaped and
you'll be in exactly the same situation you started in.
You need to replace single & characters with two of them in the string
for each & to appear.
> so again it nice to not only "just do as ones answer is," but to
> learn
But learning correctly helps :)
> But since I can’t predict what other characters one might try using
> in this program I will in this case use the “UseMnemonic = False”
> since that covers any and all characters.
No others need escaping in this case.
Just make sure you double up each &, OR set UseMnemonic, never both
otherwise it'll just show two in the label.
--
Deanna Earley (
dee.e...@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored. Please reply to the
group.)