Back to Devexpress

SuperToolTip.Items Property

windowsforms-devexpress-dot-utils-dot-supertooltip-a9c6d0b3.md

latest6.1 KB
Original Source

SuperToolTip.Items Property

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

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

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

Property Value

TypeDescription
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.

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

csharp
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;
}
vb
Imports DevExpress.Utils

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    CreateSuperTooltip(barButtonItemChart)
End Sub

Private Sub CreateSuperTooltip(ByVal barItem As BarItem)
    Dim superTip As New SuperToolTip()
    Dim item As New ToolTipItem()
    If barItem.ImageOptions.SvgImage IsNot Nothing Then
        item.ImageOptions.SvgImage = barItem.ImageOptions.SvgImage
    End If
    item.Text = "Transform data to its most appropriate and readable visual representation. Insert bar charts, pie graphs, line graphs, or financial diagrams."
    Dim footer As New ToolTipItem()
    superTip.AllowHtmlText = DefaultBoolean.True
  footer.Text = "Learn more on www.devexpress.com"
    superTip.Items.AddTitle("Add a Chart")
    superTip.Items.Add(item)
    superTip.Items.AddSeparator()
    superTip.Items.Add(footer)
    barItem.SuperTip = superTip
End Sub

Example 2

Create the SuperToolTipSetupArgs object, customize its settings, and pass it to the SuperToolTip.Setup method.

csharp
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;
}
vb
Imports DevExpress.Utils

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    SetupSuperTooltip(barButtonItemChart)
End Sub

Private Sub SetupSuperTooltip(ByVal barItem As BarItem)
  Dim superTip As New SuperToolTip()
  Dim args As 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 IsNot Nothing Then
      args.Contents.ImageOptions.SvgImage = barItem.ImageOptions.SvgImage
  End If
  args.ShowFooterSeparator = True
  args.Footer.Text = "Learn more on www.devexpress.com"
  superTip.Setup(args)
  barItem.SuperTip = superTip
End Sub

See Also

Setup(SuperToolTipSetupArgs)

Hints and Tooltips

SuperToolTip Class

SuperToolTip Members

DevExpress.Utils Namespace