SuperToolTip.Setup(SuperToolTipSetupArgs) Method
Creates tooltip items based on the specified setup information.
Namespace: DevExpress.Utils
Assembly: DevExpress.Utils.v24.1.dll
NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core
Declaration
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 following examples demonstrate two different approaches to create a super tooltip ( SuperToolTip ) and assign in to a bar item. The super tooltip includes the title, main content, separator, and footer.
Example 1
using DevExpress.Utils;
private void Form1_Load(object sender, EventArgs e) {
CreateSuperTooltip(barButtonItemChart);
}
void CreateSuperTooltip(BarItem barItem) {
SuperToolTip superTip = new SuperToolTip();
ToolTipItem item = new ToolTipItem();
if(barItem.ImageOptions.SvgImage != null)
item.ImageOptions.SvgImage = barItem.ImageOptions.SvgImage;
item.Text = "Transform data to its most appropriate and readable visual representation. Insert bar charts, pie graphs, line graphs, or financial diagrams.";
ToolTipItem footer = new ToolTipItem();
superTip.AllowHtmlText = DefaultBoolean.True;
footer.Text = "<a href=\"https://www.devexpress.com\">Learn more</a>";
superTip.Items.AddTitle("Add a Chart");
superTip.Items.Add(item);
superTip.Items.AddSeparator();
superTip.Items.Add(footer);
barItem.SuperTip = superTip;
}
Example 2
Create the SuperToolTipSetupArgs
object, customize its settings, and pass it to the SuperToolTip.Setup
method.
using DevExpress.Utils;
private void Form1_Load(object sender, EventArgs e) {
SetupSuperTooltip(barButtonItemChart);
}
void SetupSuperTooltip(BarItem barItem) {
SuperToolTip superTip = new SuperToolTip();
SuperToolTipSetupArgs args = new SuperToolTipSetupArgs();
args.Title.Text = "Add a Chart";
args.Contents.Text = "Transform data to its most appropriate and readable visual representation. Insert bar charts, pie graphs, line graphs, or financial diagrams.";
if(barItem.ImageOptions.SvgImage != null)
args.Contents.ImageOptions.SvgImage = barItem.ImageOptions.SvgImage;
args.ShowFooterSeparator = true;
args.Footer.Text = "<a href=\"https://www.devexpress.com\">Learn more</a>";
superTip.Setup(args);
superTip.AllowHtmlText = DefaultBoolean.True;
barItem.SuperTip = superTip;
}