How to create SuperTooltip using code
Categories: DotNetBar for Windows Forms, How To
Creating Super Tooltips using code only is simple. Use following code:
C#:
// SuperTooltipInfo type describes Super-Tooltip SuperTooltipInfo superTooltip = new SuperTooltipInfo(); superTooltip.HeaderText = "Header text"; superTooltip.BodyText = "Body text with <strong>text-markup</strong> support. Header and footer support text-markup too."; superTooltip.FooterText = "My footer text"; // Assign tooltip to a control or DotNetBar component superTooltip1.SetSuperTooltip(textBoxX1, superTooltip); // To remove tooltip from a control or component use superTooltip1.SetSuperTooltip(textBoxX1, null);
VB:
' SuperTooltipInfo type describes Super-Tooltip Dim superTooltip As New SuperTooltipInfo() superTooltip.HeaderText = "Header text" superTooltip.BodyText = "Body text with <strong>text-markup</strong> support. Header and footer support text-markup too." superTooltip.FooterText = "My footer text" ' Assign tooltip to a control or DotNetBar component superTooltip1.SetSuperTooltip(textBoxX1, superTooltip) ' To remove tooltip from a control or component use superTooltip1.SetSuperTooltip(textBoxX1, Nothing)
To get any super-tooltip associated with the control you can use GetSuperTooltip method which will return reference to SuperTooltipInfo that is assigned to the control or null/nothing if no super-tooltip is attached to the control.
Related posts:
Leave a Reply!