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

BaseControl.SuperTip Property

Gets or sets a SuperToolTip for the current control.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("ToolTip")]
public virtual SuperToolTip SuperTip { get; set; }

Property Value

Type Description
SuperToolTip

A SuperToolTip object associated with the control.

Remarks

Controls derived from the BaseControl class support regular tooltips and SuperToolTip objects. The SuperTip property allows you to assign a SuperToolTip object to the control. A regular hint is specified by the BaseControl.ToolTip property.

It's possible to use HTML formatting in regular and SuperToolTips. To enable HTML formatting in regular tooltips, use the BaseControl.AllowHtmlTextInToolTip property. To enable HTML formatting in SuperToolTips, use the SuperToolTip.AllowHtmlText property. See HTML Text Formatting to learn more.

The BaseControl.ToolTipController property determines the ToolTipController which manages tooltips for the control. The type of tooltips displayed by controls is determined by the ToolTipController.ToolTipType property.

See Tooltips, for more information.

Examples

This example shows how to create a SuperToolTip containing a hyperlink for a SimpleButton.

The SimpleButton control provides the BaseControl.SuperTip inherited property that allows you to set a tooltip. To enable use of the <href> tag and other HTML text formatting tags in tooltips, activate the HTML Text Formatting feature (for instance, via the SuperToolTip.AllowHtmlText property). To respond to clicking a hyperlink, handle the ToolTipController.HyperlinkClick event.

The code that creates a SuperToolTip for a button is shown at the end of this section. At design time, you can create a SuperToolTip for a button as shown below. In this case, you still need to implement the HyperlinkClick event in code.

At design time, select the SimpleButton control and click the ellipses button within the SuperTip row in the Properties window:

SimpleButton-SuperTip property

This invokes the SuperToolTip Editor, which allows you to set the tooltip content and activate the HTML formatting feature:

ToolTipController - Designer

When you run the application, the result will be as follows:

ToolTipController - HyperlinkClick

using DevExpress.Utils;
using System.Diagnostics;

private void Form1_Load(object sender, EventArgs e) {
    // Access the controller that manages tooltips for all controls:
    ToolTipController defaultTooltipController = DevExpress.Utils.ToolTipController.DefaultController;

    // Create and customize a SuperToolTip:
    SuperToolTip sTooltip = new SuperToolTip();
    SuperToolTipSetupArgs args = new SuperToolTipSetupArgs();
    args.Title.Text = "Header";
    args.Contents.Text = "This tooltip contains a hyperlink. Visit the <href=http://help.devexpress.com>DevExpress Knowledge Center</href> to learn more.";
    args.ShowFooterSeparator = true;
    args.Footer.Text = "Footer";
    sTooltip.Setup(args);
    // Enable HTML Text Formatting for the created SuperToolTip:
    sTooltip.AllowHtmlText = DefaultBoolean.True;
    //..or enable this feature for all tooltips:
    //defaultTooltipController.AllowHtmlText = true;

    // Respond to clicking hyperlinks in tooltips:
    defaultTooltipController.HyperlinkClick += defaultTooltipController_HyperlinkClick;

    // Assign a SuperToolTip to the button:
    simpleButton1.SuperTip = sTooltip;
}

void defaultTooltipController_HyperlinkClick(object sender, HyperlinkClickEventArgs e) {
    Process process = new Process();
    process.StartInfo.FileName = (e.Link);
    process.StartInfo.Verb = "open";
    process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
    try {
        process.Start();
    }
    catch { }
}
See Also