Articles in this section
Category / Section

How to provide SuperToolTip support for NumericUpDownExt?

1 min read

SuperToolTip component is used to provide extended tooltip support for any controls. You can add this SuperToolTip support for any .Net control,

For example,

  • MenuStrip
  • ToolStrip
  • Syncfusion controls
  • ToolStripEx

In order to add SuperToolTip through code, create an instance of Syncfusion.Windows.Forms.Tools.ToolTipInfo as illustrated in the following code example.

C#

//Initialize the ToolTipInfo
Syncfusion.Windows.Forms.Tools.ToolTipInfo toolTipInfo = new Syncfusion.Windows.Forms.Tools.ToolTipInfo();
//To specify the ToolTip Text
toolTipInfo.Body.Text = "SuperToolTip for NumericUpDownExt";
toolTipInfo.Header.Text = "ToolTip added from code";
toolTipInfo.Header.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
//To specify the header text alignment
toolTipInfo.Header.TextAlign = ContentAlignment.MiddleCenter;
//To specify the visual style of SuperToolTip
this.superToolTip1.VisualStyle = Syncfusion.Windows.Forms.Tools.SuperToolTip.Appearance.Metro;

VB

'Initialize the ToolTipInfo
Private toolTipInfo As New Syncfusion.Windows.Forms.Tools.ToolTipInfo()
'To specify the ToolTip Text
toolTipInfo.Body.Text = "SuperToolTip for NumericUpDownExt"
toolTipInfo.Header.Text = "ToolTip added from code"
toolTipInfo.Header.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
'To specify the header text alignment
toolTipInfo.Header.TextAlign = ContentAlignment.MiddleCenter
'To specify the visual style of SuperToolTip
Me.superToolTip1.VisualStyle = Syncfusion.Windows.Forms.Tools.SuperToolTip.Appearance.Metro

Also, the NumericUpDownExt is derived from the Windows Forms NumericUpDown control and as the NumericUpDown control contains a number of separate controls combined together, assigning the SuperToolTip for the outer control does not pass it to child controls.

Following code example is used to set the SuperToolTip to the NumericUpDownExt control.

C#

//To set the SuperToolTip NumericUpDownExt
foreach (Control ctrl in this.numericUpDownExt1.Controls)
{
    this.superToolTip1.SetToolTip(ctrl, toolTipInfo);
}

VB

'To set the SuperToolTip NumericUpDownExt
For Each ctrl As Control In Me.numericUpDownExt1.Controls
                Me.superToolTip1.SetToolTip(ctrl, toolTipInfo)
Next ctrl

 

Figure 1: NumericUpDownExt with SuperToolTip

Sample Links

C#: NumericUpDownExt_C#

VB: NumericUpDownExt_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied