StaticText control
A StaticText control displays a text string, usually as a label for another control or as explanatory text in a dialog box. It can also display dynamic text strings that are linked to a symbolic variable anywhere in the project, or act as a hyperlink that opens a web page, a file, or executes installer actions when clicked.
Tip: To use a StaticText control as a label for another control, the StaticText control should precede the other control in the dialog's tab order. You can achieve this in the Dialogs tree on the Dialogs project page by moving the StaticText control to immediately above the other control.
Tip: To change the tab and Z-order of a control in a dialog box (i.e., the order in which they are drawn and how they appear "on top" of each other), select the control in the dialog/control tree in the left pane on the Dialogs project page, then use Ctrl+Up and Ctrl+Down to move the control up or down in the order. These keystrokes are shortcuts for the Move Up and Move Down commands on the control's context menu.
Dynamic text display
You can use a StaticText control to display a dynamic text string by linking it to a symbolic variable (see Symbol name). The control's text will be updated each time the variable's value changes.
Tip: You can also use a Set Window State action to set the StaticText control's text (or any other control's text).
Hyperlink controls
Tarma's StaticText controls can also be used as hyperlinks: if the user clicks on a hyperlink control, the corresponding web page is opened or one or more actions are executed.
You can create a hyperlink-type StaticText control as follows:
- Create the StaticText control
- Set its Type to Hyperlink
- Enter the user-visible caption text in the Caption field.
Do one of the following:
- Enter the hyperlink target in the Hyperlink field. This can be a URL (for example, https://tarma.com/ or mailto:support@tarma.com; be sure to include the appropriate protocol identifier), or a file path (for example, <WindowsFolder>\notepad.exe or <INSTALLDIR>\Readme.txt).
--or-- - Leave the Hyperlink field empty and assign one of the standard IDxxx control identifiers to the Control ID field; this will cause the corresponding default action to be executed when the user clicks the hyperlink.
--or-- - Leave the Hyperlink field empty and create an event handler for the control's OnClicked event instead. In the event handler, add whatever actions you want the installer to perform when the user clicks the hyperlink.
- If you want the hyperlink to appear as a hyperlink, then set its Font attribute to UnderlineFont (use ... to select the font) and set Color to Hyperlink.
Attributes
The following attributes and options are available.
Attribute | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Control name | Enter the internal name for the control. This name is for use in InstallMate only; it is not used in the installer. All control names must be unique within their parent dialog box. | ||||||||||||||||||||||
Control ID | Select a control ID from the drop-down list or type a numerical ID to use for this control. All controls within a dialog must have different control IDs. For StaticText controls, you should generally select Automatic. However, if you want a hyperlink-type control to behave as a PushButton control (in particular, if you want InstallMate to execute the same default action), then you should select the appropriate IDxxx value. See Dialog control IDs for an explanation of the available control IDs and their usage. |
||||||||||||||||||||||
Caption type | Select the desired StaticText control behavior from the drop-down list. The following choices are available:
|
||||||||||||||||||||||
Caption | Enter the text for the control's caption; any symbolic references in the Caption are resolved when the control is first displayed. If Type is set to Dynamic, this text will be replaced by the linked variable's value when the dialog is shown and updated whenever the variable's value changes (see Symbol name below). If you want a letter to appear underlined and act as a keyboard accelerator (as in the Windows' Label: style), you should prefix the letter with an ampersand ('&'). For example, &Label will appear as Label in the dialog box. Note: The visibility of the underline is subject to the Windows settings on the target system (and your own development system); on Windows 2000 and later, the underline only appears if you first press the Alt key. |
||||||||||||||||||||||
Localized | Check this box to localize the Caption field and use different captions for different languages. | ||||||||||||||||||||||
Hyperlink | Enter the hyperlink target path. This can be anything that the Win32 function ShellExecute knows how to handle, including URLs such as https://tarma.com/ and mailto:support@tarma.com (be sure to include the appropriate protocol identifier), or file paths such as <WindowsFolder>\notepad.exe (an executable program) and <INSTALLDIR>\Readme.txt (a document file). You can leave this field empty if you want to use the hyperlink-style control to execute a different action than opening a URL or file. In that case, either assign the appropriate predefined IDxxx control identifier in the Control ID field, or define an event handler for the control's OnClicked event with the desired actions. Note: This action requires that an appropriate shell handler is registered for the protocol. This may not always be the case; for example, Core installations have very few protocol handlers registered (no http: handler, for example). |
||||||||||||||||||||||
Format | Select the desired format for the dynamic control text from the drop-down list. The following choices are available:
|
||||||||||||||||||||||
Ellipsis | Select the desired behavior if the control's Caption text is longer than the width of the control. The following choices are available:
|
||||||||||||||||||||||
No prefix | Check this box to display ampersands (&) in the control's Caption text as-is; clear it to interpret them as keyboard accelerators. In the latter case, the ampersand itself is not displayed, but the character following it is underlined and acts as an Alt+character keyboard accelerator. You should check this box if you don't want this behavior. | ||||||||||||||||||||||
Center vertically | Check this box to center the Caption text vertically in the control; clear it to align it at the top of the control's area. | ||||||||||||||||||||||
Symbol name | Enter the name of the symbolic variable to which the control must be linked, or click ... (browse) to open the Select Symbolic Variable dialog box that allows you to select a variable from the project. The control's caption will display the value of the linked variable and will be updated automatically whenever the variable's value changes. |
||||||||||||||||||||||
Indirect symbol | Check this box to make the Symbol name link indirect; clear it for a direct link. If the link is indirect, the variable specified in the Symbol name field is used to obtain the name of a second variable, and it is this second variable whose value is monitored by the control. With a direct link, the variable specified by the Symbol name attribute itself is monitored. | ||||||||||||||||||||||
Font | Select the font style for the text in the control by clicking ... (browse) to open the Select Font Style dialog. If no font style is selected, the control uses the parent dialog's font style. You can remove the font style by clicking X (clear). | ||||||||||||||||||||||
Text color | Select the desired text color from the drop-down list. The following choices are available:
Note: The actual display colors depend on the Windows' settings. If the user has selected a different color scheme, then the control will use the appropriate colors from that scheme. |
||||||||||||||||||||||
Background | Select the desired background color from the drop-down list. The following choices are available:
Note: The actual display colors depend on the Windows' settings. If the user has selected a different color scheme, then the control will use the appropriate colors from that scheme. Note: If you select Transparent, then the Background color option will be ignored. |
||||||||||||||||||||||
Horizontal align | Select the desired alignment for the control's Caption text. The following choices are available:
|
||||||||||||||||||||||
Enabled Tab stop Group Border Sunken Client edge Visible Transparent Don't mirror |
These are all standard control styles; see Dialog control styles for a description. Note: If you select Transparent, then the Background color option will be ignored. |
||||||||||||||||||||||
Condition | Enter the display condition for the control or leave empty to display the control unconditionally. See Dialog control conditions for more information. |