SuperToolTip.Items Property

Gets the collection of objects that represent regions (title, content, etc.) in a super tooltip.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v20.1.dll

Declaration

[Browsable(false)]
public ToolTipItemCollection Items { get; }
<Browsable(False)>
Public ReadOnly Property Items As ToolTipItemCollection

Property Value

Type Description
DevExpress.Utils.ToolTipItemCollection

The collection of objects that represent regions (title, content, etc.) in a super tooltip.

Remarks

A super tooltip consists of multiple regions: title, content, footer, separators. Use the Items property to access/add/remove objects that represent the regions:

  • ToolTipItem — the main region in a super tooltip that displays text and/or image.
  • ToolTipTitleItem — a region displayed at the top (title) or bottom (footer) of a tooltip. This region differs from the main region in default appearance settings.
  • ToolTipSeparatorItem — a horizontal line in a tooltip.

Regions are displayed in the tooltip one under another in the same order as in the collection.

Examples

The code below creates a SuperToolTip object that represents a super tooltip. The tooltip consists of two regions: title and content. The title displays "Edit Popup Menu". The content displays an image and "Show the Edit popup menu".

SuperTooltip.Setup_ex

The example shows two approaches to add regions to a super tooltip:

using DevExpress.Utils;

// The component used to load images from a form's resources.
System.ComponentModel.ComponentResourceManager resources = 
  new System.ComponentModel.ComponentResourceManager(typeof(Form1));
// The image to display within a super tooltip.
Image resImage = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));

// FIRST APPROACH
// Create an object that represents a super tooltip.
SuperToolTip sTooltip1 = new SuperToolTip();
// Create an object that represents the title.
ToolTipTitleItem titleItem1 = new ToolTipTitleItem();
titleItem1.Text = "Edit Popup Menu";
// Create an object that represents the content.
ToolTipItem item1 = new ToolTipItem();
item1.ImageOptions.Image = resImage;
item1.Text = "Show the Edit popup menu";
// Add the items to the SuperTooltip.Items collection.
sTooltip1.Items.Add(titleItem1);
sTooltip1.Items.Add(item1);

// Assign the created SuperToolTip to a BarItem.
barItem1.SuperTip = sTooltip1;

// SECOND APPROACH
// Create an object that represents a super tooltip.
SuperToolTip sTooltip2 = new SuperToolTip();
// Create an object that initializes tooltip regions.
SuperToolTipSetupArgs args = new SuperToolTipSetupArgs();
args.Title.Text = "Edit Popup Menu";
args.Contents.Text = "Show the Edit popup menu";
args.Contents.ImageOptions.Image = resImage;
sTooltip2.Setup(args);

// Assign the created SuperToolTip to a BarItem.
barItem2.SuperTip = sTooltip2;
See Also