Class SfToolTip
Represents a ToolTip window that displays a brief description about a control when user rests the mouse on that control.
Inherited Members
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class SfToolTip : BaseComponent, IThemeProvider, IVisualStyle, IDisposable, IExtenderProvider
Examples
This sample shows how to set tooltip text for a control.
SfToolTip sfToolTip = new SfToolTip();
sfToolTip.SetToolTip(this.button1, "Sample Tooltip");
This sample shows how to set ToolTipInfo for a control to show as a tooltip.
SfToolTip sfToolTip = new SfToolTip();
ToolTipInfo tooltipInfo1 = new ToolTipInfo();
ToolTipItem toolTipItem1 = new ToolTipItem();
toolTipItem1.Text = "Tooltip item 1 text";
ToolTipItem toolTipItem2 = new ToolTipItem();
toolTipItem2.Text = "Tooltip item 2 text";
toolTipInfo.Items.AddRange(new ToolTipItem[] { toolTipItem1, toolTipItem2});
sfToolTip.SetToolTipInfo( this.button2, toolTipInfo);
Constructors
SfToolTip()
Initializes a new instance of the
Declaration
public SfToolTip()
SfToolTip(IContainer)
Initializes a new instance of the SfToolTip class.
Declaration
public SfToolTip(IContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.IContainer | container | The container in which the SfToolTip component has to be added. |
Properties
AutoPopDelay
Gets or sets the period of time the ToolTip remains visible if the pointer is stationary on a control.
Declaration
public int AutoPopDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The period of time, in milliseconds, that the ToolTip remains visible when the pointer is stationary on a control. The default value is 5000. |
Remarks
By using
InitialDelay
Gets or sets the time that passes before the ToolTip appears.
Declaration
public int InitialDelay { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Remarks
By using
ShadowVisible
Gets or sets a value indicating whether shadow should be drawn for the ToolTip.
Declaration
public bool ShadowVisible { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
CanExtend(Object)
Specifies whether this object can provide its extender properties to the specified object.
Declaration
protected static bool CanExtend(object extendee)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | extendee | The Object to receive the extender properties. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if this object can provide extender properties to the specified object; otherwise, false. |
Dispose(Boolean)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
GetControlName(String)
Helps to apply the ControlName settings in control
Declaration
public override string GetControlName(string controlName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | controlName | The ControlName. |
Returns
| Type | Description |
|---|---|
| System.String | Returns the control name. |
Overrides
GetToolTip(Control)
Gets the tooltip text of the Control.
Declaration
public string GetToolTip(Control control)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Control | control | An object of control. |
Returns
| Type | Description |
|---|---|
| System.String | Returns the tooltip text of the control. |
GetToolTipInfo(Control)
Gets the ToolTipInfo of the Control.
Declaration
public ToolTipInfo GetToolTipInfo(Control control)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Control | control | An object of control. |
Returns
| Type | Description |
|---|---|
| ToolTipInfo | Returns the ToolTipInfo of the control. |
Hide()
Hides the ToolTip, if it is being displayed.
Declaration
public void Hide()
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | themeName | The ThemeName. |
Overrides
RaiseThemeChanged(Object, ThemeChangedEventArgs)
Raises the
Declaration
protected override void RaiseThemeChanged(object sender, ThemeChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The sender value. |
| ThemeChangedEventArgs | args | A ThemeChangedEventArgs contains the event data. |
Overrides
RemoveToolTip(Control)
Disables the ToolTip for the specified control.
Declaration
public void RemoveToolTip(Control control)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Control | control | The control for which the ToolTip has to be disabled. |
SetToolTip(Control, String)
Associates the ToolTipInfo with the specified control.
Declaration
public void SetToolTip(Control control, string toolTipText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Control | control | The control to associate with the ToolTipInfo. |
| System.String | toolTipText | The tooltip text to be displayed when the pointer is on the control. |
SetToolTipInfo(Control, ToolTipInfo)
Associates the ToolTipInfo with the specified control.
Declaration
public void SetToolTipInfo(Control control, ToolTipInfo toolTipInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Control | control | The control to associate with the ToolTipInfo. |
| ToolTipInfo | toolTipInfo | The ToolTipInfo to be displayed when the pointer is on the control. |
Show(ToolTipInfo)
Shows the ToolTip with the ToolTipInfo at the cursor position.
Declaration
public void Show(ToolTipInfo toolTipInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
Show(ToolTipInfo, Point)
Shows the ToolTip with the ToolTipInfo at the specified relative position.
Declaration
public void Show(ToolTipInfo toolTipInfo, Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
| System.Drawing.Point | point | A point in which the ToolTip to be displayed. |
Show(ToolTipInfo, Point, Int32)
Shows the ToolTip with the ToolTipInfo at the specified relative position for a specified duration.
Declaration
public void Show(ToolTipInfo toolTipInfo, Point point, int popupDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
| System.Drawing.Point | point | A point in which the ToolTip to be displayed. |
| System.Int32 | popupDelay | The period of time that the ToolTip should remain visible. |
Show(ToolTipInfo, Point, Int32, Int32, Boolean)
Shows the ToolTip with the ToolTipInfo at the specified relative position for a specified duration with specified initial delay. ToolTip location will be adjusted with respect to the screen bounds, if adjustToScreenBounds value is true.
Declaration
public void Show(ToolTipInfo toolTipInfo, Point point, int initialDelay, int popupDelay, bool canAdjustToScreenBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
| System.Drawing.Point | point | A point in which the ToolTip to be displayed. |
| System.Int32 | initialDelay | The period of time that passes before the ToolTip appears. |
| System.Int32 | popupDelay | The period of time that the ToolTip should remain visible. |
| System.Boolean | canAdjustToScreenBounds | Specifies whether to adjust the ToolTip location respective to the screen bounds. |
Show(ToolTipInfo, Int32, Int32)
Shows the ToolTip with the ToolTipInfo at the specified relative position.
Declaration
public void Show(ToolTipInfo toolTipInfo, int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
| System.Int32 | x | The horizontal offset position in which the ToolTip has to be displayed. |
| System.Int32 | y | The vertical offset position in which the ToolTip has to be displayed. |
Show(ToolTipInfo, Int32, Int32, Int32)
Shows the ToolTip with the ToolTipInfo at the specified relative position for a specified duration.
Declaration
public void Show(ToolTipInfo toolTipInfo, int x, int y, int popupDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolTipInfo | toolTipInfo | ToolTipInfo to be displayed as ToolTip. |
| System.Int32 | x | The horizontal offset position in which the ToolTip has to be displayed. |
| System.Int32 | y | The vertical offset position in which the ToolTip has to be displayed. |
| System.Int32 | popupDelay | The period of time that the ToolTip should remain visible. |
Show(String)
Shows the ToolTip with the tooltip text at the cursor position.
Declaration
public void Show(string toolTipText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toolTipText | The text to be displayed as tooltip. |
Show(String, Point)
Shows the ToolTip with the tooltip text at the specified relative position.
Declaration
public void Show(string toolTipText, Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toolTipText | The text to be displayed as tooltip. |
| System.Drawing.Point | point | A point in which the ToolTip to be displayed. |
Show(String, Point, Int32)
Shows the ToolTip with the tooltip text for the specified duration at the specified relative position.
Declaration
public void Show(string toolTipText, Point point, int popupDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toolTipText | The text to be displayed as tooltip. |
| System.Drawing.Point | point | A point in which the ToolTip to be displayed. |
| System.Int32 | popupDelay | The period of time that the ToolTip should remain visible. |
Show(String, Int32, Int32)
Shows the ToolTip with the tooltip text at the specified relative position.
Declaration
public void Show(string toolTipText, int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toolTipText | The text to be displayed as tooltip. |
| System.Int32 | x | The horizontal offset position in which the ToolTip has to be displayed. |
| System.Int32 | y | The vertical offset position in which the ToolTip has to be displayed. |
Show(String, Int32, Int32, Int32)
Shows the ToolTip with the tooltip text for the specified duration at the specified relative position.
Declaration
public void Show(string toolTipText, int x, int y, int popupDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | toolTipText | The text to be displayed as tooltip. |
| System.Int32 | x | The horizontal offset position in which the ToolTip has to be displayed. |
| System.Int32 | y | The vertical offset position in which the ToolTip has to be displayed. |
| System.Int32 | popupDelay | The period of time that the ToolTip should remain visible. |
Events
DrawToolTipItem
Occurs before drawing the tooltip item.
Declaration
public event DrawToolTipItemEventHandler DrawToolTipItem
Event Type
| Type |
|---|
| DrawToolTipItemEventHandler |
Remarks
By using the
ThemeChanged
Occurs when theme name of the
Declaration
public event ThemeChangedEventHandler ThemeChanged
Event Type
| Type |
|---|
| ThemeChangedEventHandler |
ToolTipShowing
Occurs when the tooltip is showing.
Declaration
public event ToolTipShowingEventHandler ToolTipShowing
Event Type
| Type |
|---|
| ToolTipShowingEventHandler |
Remarks
The
ToolTipShown
Occurs when the tooltip is shown.
Declaration
public event ToolTipShownEventHandler ToolTipShown
Event Type
| Type |
|---|
| ToolTipShownEventHandler |
Remarks
The