Accelerator Characters in Control Labels

XAML uses the first single underscore in a control label to define the character that follows the underscore as an accelerator character for the control. This is different from PowerScript, which uses an ampersand to signal an accelerator character.

When you migrate PowerBuilder Classic targets to PowerBuilder .NET, the ampersand that signals an accelerator character in PowerScript is converted to an underscore. If the control label has an underscore in it, the migration adds an extra underscore as an escape character, and XAML displays the control label with a single underscore that is a regular part of the label text. You cannot use the underscore character itself as an accelerator in XAML.

However, as in PowerBuilder Classic, accelerator characters in PowerBuilder .NET control labels appear with an underscore in the label.

Although migration converts the accelerator characters for PowerBuilder Classic targets, any new accelerator characters you want to use in Script views or in the XAML editor must follow the XAML accelerator character rules. The rules for accelerator characters apply to CommandButton, PictureButton, CheckBox, RadioButton, StaticText, StaticHyperlink, and GroupBox controls.

In XAML, the control label myCommandButton__1_x designates the character x as the accelerator for the control: myCommandButton_1 x. In this example, x is the first character after a single underscore, which marks it as an accelerator character.