A ToolTip is used to display text when the mouse hovers over the control. The C1MainMenu class provides the ShowToolTips property to indicate whether the menu item can show the tooltip text when the mouse cursor hovers over it. By default, this property is false.
When you set the ShowToolTips property to true, the value of the Text property of the menu item is displayed as the tooltip. For example, if we have a menu item in the main menu with text value as File, then the tooltip will appear as follows:
You can also set a custom text as the tooltip of each menu item. For doing so, set the ShowTextAsToolTip property to False and then set the custom text using the ToolTipText property. For instance, if we have a menu item with text value as File and the ToolTip Text set as 'View File', then the tooltip will appear as shown below.
To display the tooltip text, use the following code.
C# |
Copy Code
|
---|---|
C1CommandMenu mmenu = ch.CreateCommand(typeof(C1CommandMenu)) as C1CommandMenu; mmenu.Text = "File"; mmenu.ShowTextAsToolTip = false; mmenu.ToolTipText = "View file"; |
While you can display plain text tooltips for the MainMenu control, it is also possible to display tooltips with rich HTML text, and use different fonts. To display such tooltips, use SuperTooltip property of the C1MainMenu class, which gets an external SuperToolTip control for the MainMenu.
The following image depicts a supertooltip that appears on hovering over the File menu.
To configure the SuperTooltip, follow the steps below:
For more information on how to use the ToolTips, see Displaying ToolTips for Menus and Toolbars.