Skip to main content
A newer version of this page is available. .

ToolTipItem Class

A regular tooltip item in a SuperToolTip that displays text and/or an image.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v18.2.dll

Declaration

public class ToolTipItem :
    BaseToolTipItem,
    ISerializable,
    IDisposable

Remarks

Along with the ToolTipTitleItem and ToolTipSeparatorItems, the ToolTipItem can be used to construct a SuperToolTip object. A ToolTipItem object is a regular item, while the ToolTipTitleItem and ToolTipSeparatorItem items represent a title item and a separator, respectively.

A ToolTipItem displays text and/or graphic information. To display text information, use the ToolTipItem.Text property. It is possible to use HTML tags to format the text. To enable HTML formatting, use the ToolTipItem.AllowHtmlText property.

To display graphic information within a ToolTipItem, you can use the following properties:

The ToolTipItem class provides properties for content formatting:

Example

The following example demonstrates how to create a SuperToolTip object with a ToolTipItem object inside and assign it to a button.

using DevExpress.Utils;
//...
//Create a new instance of the SuperToolTip object.
SuperToolTip sTooltip1 = new SuperToolTip();

//Create a new instance of the ToolTipItem object.
ToolTipItem item1 = new ToolTipItem();
//Specify the properties.
item1.Image = System.Drawing.Image.FromFile("d:\\image.bmp");
item1.Text = "This is <i>the text</i> in <b>the tooltip</b>";
item1.ImageToTextDistance = 50;
item1.AllowHtmlText = DefaultBoolean.True;

// Add the tooltip item to the SuperTooltip.
sTooltip1.Items.Add(item1);

// Assign the created SuperToolTip to a Button.
simpleButton1.SuperTip = sTooltip1;

Inheritance

Object
DevExpress.Utils.BaseToolTipObject
DevExpress.Utils.BaseToolTipItem
ToolTipItem
See Also