Class
ToolTip
Warning
This item was deprecated in version 2019r2. Please use DesktopApplication.ShowTooltip and DesktopApplication.HideTooltip as a replacement.
Description
Used to create and display a ToolTip at the user-specified location.
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
✓ |
|||
tip As String, x As Integer, y As Integer, autoHide As Boolean |
✓ |
Method descriptions
ToolTip.Hide
Hide
Hides the ToolTip. Call this if the AutoHide parameter of the Application.ShowTooltip method was False.
This method is shared.
Call this if you had passed False to the corresponding call to Application.ShowTooltip or you are not programming for macOS and need to hide the ToolTip manually.
Tooltip.Hide
ToolTip.Show
Show(tip As String, x As Integer, y As Integer, autoHide As Boolean)
Pops up the passed tip at the global coordinates given by x, y (relative to the screen). If AutoHide is True, then the tip will automatically hide itself; you do not have to call Application.HideTooltip to hide it. The default is True.
This method is shared.
AutoHide is used only on Windows and Linux; on macOS, the ToolTip hides automatically.
The following code is placed in the MouseDown event of a window. It uses the X and Y coordinates passed into the event.
ToolTip.Show("This is my tip", Self.Left + X, Self.Top + Y)
Return True
The following line in the Action event of a PushButton displays the contents of a TextField as a tip.
ToolTip.Show(TextField1.Text, System.MouseX, System.MouseY + 20)
Notes
Warning
This class is deprecated as mentioned above. If you still need to use this class in your 2019r2 or later projects, you must use the "Global." prefix (Example: Global.Tooltip.Hide) otherwise you will get a compilation error. However, it's recommended that you migrate to the replacement methods.
Since the ToolTip class's methods are shared methods, you do not need to instantiate an instance of the class in order to use it.
Sample code
The following code is placed in the MouseDown event of a Window. It uses the X and Y coordinates passed into the event.
ToolTip.Show("This is my tip", Self.Left + X, Self.Top + Y)
Return True
The following line in the Action event of a PushButton displays the contents of a TextField as a tip.
Tooltip.Show(TextField1.Text, System.MouseX, System.MouseY + 20, True)
Compatibility
All project types on all supported operating systems.
See also
Object parent class; RectControl.Tooltip property