Designating Keyboard Shortcuts and Using Ampersands (&) in the Wizard Interface

InstallShield 2015

Project: This information applies to the following project types:

Advanced UI
Suite/Advanced UI

Edition: The Advanced UI project type is available in the Professional edition of InstallShield. The Suite/Advanced UI project type is available in the Premier edition of InstallShield. For information about the differences between these two project types, see Advanced UI Projects vs. Suite/Advanced UI Projects.

In wizard interface strings, an ampersand (&) is a special character that sometimes designates a keyboard shortcut, but other times indicates that a literal ampersand should be displayed. For button, check box, and radio button controls, a single ampersand always designates the keyboard shortcut that is used to click or select the control; a double ampersand (&&) indicates that a single ampersand should be displayed. For label controls, the interpretation of an ampersand depends on the style of the label control in which the ampersand is used.

Using Ampersands in Label Controls of the Wizard Interface

Sample String Entry for a Label Control

Status of SS_NOPREFIX in the Style Setting of the Control

String That Is Displayed in the Wizard Interface

Notes

Enter your &serial number for New && Improved Product

SS_NOPREFIX = False

Enter your serial number for New & Improved Product

When an end user presses the ALT key, the “s” in the string is underlined. The keyboard shortcut of ALT+s moves the focus to the control that appears directly after this label in the tab order.

The double ampersand between “New” and “Improved” indicates that a single ampersand should be displayed.

Enter your serial number for New & Improved Product

SS_NOPREFIX = True

Enter your serial number for New & Improved Product

The True value for the SS_NOPREFIX constant prevents any ampersands in the control’s string from being used to designate a keyboard shortcut.

By default, when you add a new label control to your wizard interface, the SS_NOPREFIX subsetting under the label control’s Style setting is set to False. You can change this value as needed.

If your wizard interface includes a label control that should never contain a keyboard shortcut, consider selecting True for the SS_NOPREFIX subsetting of that control. This ensures that any ampersands that are included in the string entries for such controls are not inadvertently interpreted as keyboard shortcuts.

If your product name includes an ampersand, you may want to use two separate product name properties in your wizard interface—one property whose value uses a single ampersand, and one property whose value uses the escaped ampersand (a double ampersand). Depending on the type and style of each control that contains the product name, you would use the appropriate product name property as needed—for example:

Sample Usage of Two Different Properties for a String that Includes an Ampersand

Property

Property Value

Examples of Uses for This Property

[ProductName]

New & Improved Product

Label controls in which SS_NOPREFIX = True
Wizard Caption setting on the Wizard Pages node—This value is used as the caption in the caption bar of wizard pages. The default value of this setting is:

[ProductName] - InstallShield Wizard

Title setting for a wizard page—The title text is displayed in the header area of wizard pages.

[EscapedProductName]

New && Improved Product

Label controls in which SS_NOPREFIX = False
Controls such as check boxes, command links, and radio buttons, which do not support the SS_NOPREFIX style setting and always interpret single ampersands as being used to designate keyboard shortcuts

See Also