User forums > General (but related to Code::Blocks)

Syntax for using Ampersand (&) in labels, etc. Ver 16.01 Linux.

(1/1)

Aaron:
Does anyone know the required syntax for using the '&' character in labels, etc?

Placing one '&' in a label produces a space, two '&' characters produce an underscore.

I did search the manual & forums for this answer.

oBFusCATed:
What labels? wx, qt, win32, something else?

Aaron:
For wxStaticText and wxButtons.

sodev:
Looks like wxWidgets coding issues, not Codeblocks fault.

BlueHazzard:
http://docs.wxwidgets.org/3.0/classwx_menu_item.html


--- Quote ---The label string for the normal menu items (not separators) may include the accelerator which can be used to activate the menu item from keyboard. An accelerator key can be specified using the ampersand & character. In order to embed an ampersand character in the menu item text, the ampersand must be doubled.
--- End quote ---

Navigation

[0] Message Index

Go to full version