ComponentOne Ribbon for WinForms
C1Ribbon (Classic) Task-Based Help / Displaying ToolTips for the Ribbon Items
In This Topic
    Displaying ToolTips for the Ribbon Items
    In This Topic

    To display a ToolTip for a Ribbon item, use the smart designer, Properties window, or add code to set the RibbonItem.ToolTip property. Each option is described below.

    Note: To learn how to create a rich ToolTip, see Creating a Rich ToolTip.

    To Display ToolTips Using the Smart Designer

    Complete the following steps:

    1. Select the toggle button to activate the element and to enable the toggle button's floating toolbar:
    2. From the floating toolbar, click the Text Settings button . The Text Settings dialog box appears.
    3. In the ToolTip box enter the ToolTip text, for example, Bold.
    4. Click the x or click outside the Text Settings dialog box to accept your changes.
    5. Save and run your application. The "Bold" ToolTip text will appear for the Ribbon toggle button when you mouse over the Bold button.

    To Display ToolTips Using the Properties Window

    Optionally, you can set the RibbonItem.ToolTip property using the Properties window. Click the toggle button to reveal the item's properties in the Properties window. Locate the RibbonItem.ToolTip property and enter the ToolTip text in the box, for example, Bold.

    To Display ToolTips Programmatically

    Note: In the following example an embedded resource containing the (16x16) image is used: Bold.png. To embed a resource, from the Project menu, choose YourProjectName Properties. From the Resources tab, select Add Resource and choose to add an existing file or add a new one.

    To set the ToolTip text for a toggle button to Bold, add the following code to your project:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' type the Imports directive for the namespace
    Imports C1.Win.C1Ribbon
     
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With RibbonToggleButton1
            ' No text label
            .Text = ""
            ' Set the 16x16 image
            .SmallImage = My.Resources.Bold;
            ' Show a ToolTip
            .ToolTip = "Bold"
        End With
    End Sub
    

    To write code in C#

    C#
    Copy Code
    // type the using directive for the namespace
    using C1.Win.C1Ribbon;
     
    private void Form1_Load(object sender, System.EventArgs e)
    {
        // No text label
        this.ribbonToggleButton1.Text = "";
        // Set the 16x16 image
        this.ribbonToggleButton1.SmallImage = My.Resources.Bold;
        // Show a ToolTip
        this.ribbonToggleButton1.ToolTip = "Bold";
    }