Using the ShowTooltip Method
Use the ShowToolTip method to add a tooltip to an interrogated control from a web or Windows application. This method is one of the general methods available for interrogated controls. A tooltip is a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control. See the example automation using this method.
There are five overloads for this method:
1 parameter: String text
2 parameters: String text, String title
3 parameters: String text, String title, ToolTipIcon icon
5 parameters: String text, String title, ToolTipIcon icon, Color textColor, Color backgroundColor
7 parameters: String text, String title, ToolTipIcon icon, Color textColor, Color backgroundColor, ToolTipAnchorPosition anchorPosition, Int32 maxWidth
These parameters are defined as follows.
Parameter |
Description |
Text |
This is the text that is displayed in the Tooltip window. If this parameter is empty, the tooltip will not appear. |
Title |
This is the title of the tooltip that is displayed at the top of the Tooltip window. |
Icon |
Determines whether or not an icon is displayed at the corner of the tooltip. Lets the user select between None, Info, Warning or Error. An icon will only appear if the text and title parameters are populated. |
TextColor |
Determines the color of the text in the Tooltip window. |
BackgroundColor |
Determines the color of the background in the Tooltip window. |
AnchorPosition |
This parameter determines to which corner of the control’s rectangle the tooltip is attached. You can select Bottom Left, Bottom Right, or Top Right. |
MaxWidth |
Determines the number of characters per line of text. |
Keep in mind...
Tooltips retain their location relative to their respective control when the containing window is moved.
Tooltips will be hidden if the control’s container is scrolled.
To display multiple lines of text in a tooltip, use the ShowTooltip method with seven parameters. Type each line of text in the Text parameter and end the line by pressing Enter. Make sure to set the TextColor and BackgroundColor parameters as well as the MaxWidth.
The following automation displays a tooltip on an HTML table when the user clicks on the table. The tooltip is used to display Help for the table.
Privacy | Trademarks | Terms of Use | Feedback
Updated: 18 June 2020
© 2016 - 2020 Pegasystems Inc. Cambridge, MA All rights reserved.