A newer version of this page is available. Switch to the current version.

SuperToolTip.Setup(SuperToolTipSetupArgs) Method

Creates tooltip items based on the specified setup information.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v19.1.dll

Declaration

public virtual void Setup(
    SuperToolTipSetupArgs info
)
Public Overridable Sub Setup(
    info As SuperToolTipSetupArgs
)

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.

Examples

The following example demonstrates a way of creating a SuperToolTip object with two tooltip items. The first item will display the "Edit Popup Menu" string. The second item will contain an image and the "Show the Edit popup menu" text.

SuperTooltip.Setup_ex

The example shows two ways of adding tooltip items to a SuperToolTip object.

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 SuperTooltip.
Image resImage = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));

// Method 1
SuperToolTip sTooltip1 = new SuperToolTip();
// Create a tooltip item that represents a header.
ToolTipTitleItem titleItem1 = new ToolTipTitleItem();
titleItem1.Text = "Edit Popup Menu";
// Create a tooltip item that represents the SuperTooltip's contents.
ToolTipItem item1 = new ToolTipItem();
item1.Image = resImage;
item1.Text = "Show the Edit popup menu";
// Add the tooltip items to the SuperTooltip.
sTooltip1.Items.Add(titleItem1);
sTooltip1.Items.Add(item1);

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

// Method 2
SuperToolTip sTooltip2 = new SuperToolTip();
// Create an object to initialize the SuperToolTip.
SuperToolTipSetupArgs args = new SuperToolTipSetupArgs();
args.Title.Text = "Edit Popup Menu";
args.Contents.Text = "Show the Edit popup menu";
args.Contents.Image = resImage;
sTooltip2.Setup(args);

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