banner 728x90

Combobox issue with & Character

In Mobile Web Development 36 views
banner 728x90

We ran into an odd one this morning.

Location names were not showing up correctly in a combo box control.

Freezer R&D was showing up as Freezer RD

It appears that the combo box control has some logic to create hot keys for the choices using the & character, just like there is for captions. The only problem is, we don’t want that!

I haven’t found a option or setting to turn it off. The only way to avoid it that I can see is to make sure that any & character is doubled up as && when displayed in a combo box control.

If you would like to see this behavior for yourself it is really easy to duplicate. Create a combo box control that is filled by programming and put the following in the initial contents.

2014-11-21_1026

And when you run the window you will see the combo contains.

2014-11-21_1027

Notice the “Single R&D” is displaying as “Single RD

I have reported this to support, and will post here when I get a response.

===================================
Update 11/30/2014

I did receive a response from pcSoft, but it was basically just confirming that it is the intended behavior and has always been there.

Fortunately Derek Theobald, from the Google+ group offered a better solution!

In the initialization code of your combo box, include the line

MySelf..InterpretAmpersand = False

This tells WX to ignore the & and not try to turn it into a shortcut.

Thanks again, Derek!

===================================

Now, back to your regular schedule program….

banner 728x90
author
Author: 
    Script & Style Show: Episode 1: Marc Grabanski
    Script & Style Show: Episode 1: Marc Grabanski
    During this second episode of the Script
    AWS AppSync region expansion and new functions for API keys
    AWS AppSync region expansion and new functions for API keys
    AWS AppSync, a managed GraphQL service with
    What is the best time to involve your mobile app users?
    What is the best time to involve your mobile app users?
    When talking to customers about mobile analysis,
    How to make a Twitter bot with Node.js
    How to make a Twitter bot with Node.js
    Twitter bots have been in the news

    Leave a reply "Combobox issue with & Character"

    Must read×

    Top