Articles in this section
Category / Section

Can SuperToolTip be displayed in custom location?

3 mins read

The SuperToolTip can be displayed at the custom location. The following steps show how to display it at custom location.

 

  1. Drag and drop the SuperToolTip into your form.

 

Figure 1: SuperToolTip in ToolBox

  1. The event named PopupToolTip helps to display the SuperToolTip at the specified location. The parameter of the PopupToolTip event rc passes the (X, Y) coordinates for each object specified through the parameter component.

The following code example demonstrates the same.

 

C#

//The event is raised on ToolTip pop up. 
this.superToolTip1.PopupToolTip += new PopupToolTipHandler(superToolTip1_PopupToolTip);
                void superToolTip1_PopupToolTip(System.ComponentModel.Component component, ref Rectangle rc)
{
    //Specifies the custom location for SuperToolTip.
    if (component == this.buttonAdv1)
    {
        rc.X = 30;
        rc.Y = 90;
    }
    if (component == this.gradientLabel1)
    {
        rc.X = 300;
        rc.Y = 300;
    }
}

 

VB

'The event is raised on ToolTip pop up.
AddHandler superToolTip1.PopupToolTip, AddressOf superToolTip1_PopupToolTip
Private Sub superToolTip1_PopupToolTip(ByVal component As System.ComponentModel.Component, ByRef rc As Rectangle)
                'Specifyies the custom location for SuperToolTip.
                If component Is Me.buttonAdv1 Then
                                rc.X = 30
                                rc.Y = 90
                End If
                If component Is Me.gradientLabel1 Then
                                rc.X = 300
                                rc.Y = 300
                End If
End Sub

 

Note: The parameter component” helps in assigning the control associated with the SuperToolTip.

 

Figure 2: SuperToolTip isspecified in custom location for ButtonAdv

 

Figure 3: SuperToolTip specified with custom location for GradientPanel

Sample Links:

C#: SuperToolTip_CustomLocation_C#

VB: SuperToolTip_CustomLocation_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