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

SuperToolTip.Setup(SuperToolTipSetupArgs) Method

Creates tooltip items based on the specified setup information.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v21.2.dll

NuGet Packages: DevExpress.Utils, DevExpress.Win.Design, DevExpress.Wpf.Core

Declaration

public virtual void Setup(
    SuperToolTipSetupArgs info
)

Parameters

Name Type Description
info DevExpress.Utils.SuperToolTipSetupArgs

A DevExpress.Utils.SuperToolTipSetupArgs object which contains initialization information.

Remarks

The Setup method removes existing tooltip items by clearing the SuperToolTip.Items collection. Then, it adds new tooltip items to the SuperToolTip.Items collection based on the information provided by the info parameter.

A DevExpress.Utils.SuperToolTipSetupArgs object provides the Title, Contents and Footer properties which represent tooltip items. The Setup method copies these tooltip items to the SuperToolTip.Items collection, provided that these properties have been initialized.

In addition, the DevExpress.Utils.SuperToolTipSetupArgs object contains the AllowHtmlText property. The Setup method copies this property’s value to the SuperToolTip’s SuperToolTip.AllowHtmlText property.

Example

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:

  • add regions to the SuperToolTip.Items collection;
  • pass a SuperToolTipSetupArgs object to the SuperToolTip.Setup method.
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