Create Tooltips and Extended Help for Commands
 
 
 
Bottom of the Page

Tooltips are descriptive messages that are displayed near the cursor when it hovers over a toolbar or panel button, or menu item.

The Description property associated to a command provides a simple description for what the command does. The value of the Description property is displayed as part of a basic tooltip that is displayed when the cursor hovers over a button on a toolbar, or ribbon panel. Along with the description, a command tooltip also displays the name of the command, and the values assigned to the Command Display Name and Tags properties.

Additionally, a command can be assigned an extended help file and ID so it can display a second level of information for the command. The content from the extended help file is displayed in the extended description area of a tooltip. The content for the extended description area of a tooltip is stored in an XAML file, and can contain rich-text and images.

Control the Display of Tooltips

You control the display of tooltips and when the extended help assigned to a command is displayed from the Options dialog box. See Set Interface Options in the User’s Guide to learn more about tooltips.

Example of an XAML File

The XAML structure is a format that was developed by Microsoft. The following is an example of what an XAML file might look like for two custom commands that exist in your CUIx file.

<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
 <src:RibbonToolTip x:Key="MYEH_CMD_0001">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Center">
 Creates a rectangular revision cloud on the <Bold>REVISION</Bold> layer.
 </TextBlock>
 <Image Source="images/rectcloud.jpg" Width="Auto" Height="Auto">
 </Image>
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
 <src:RibbonToolTip x:Key="MYEH_CMD_0002">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="Yellow" TextAlignment="Left">
 Creates a polygonal revision cloud on the
 <Run Text=" REVISION " Foreground="Red" FontStyle="Italic"/>
 layer.
 </TextBlock>
 <Image Source="images/rectcloud.jpg" Width="Auto" Height="Auto">
 </Image>
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
</ResourceDictionary>

The ResourceDictionary element is used to define the type of content that is in the XAML file; while the scr:RibbonToolTip element is used to define each of the extended help topics in the file. In the previous example there are two different extended help topics, and they are uniquely defined by the keys MYEH_CMD_0001 and MYEH_CMD_0002.

NoteExtended tooltips defined to work with AutoCAD 2009 need to be updated to work with AutoCAD 2011. For information on converting an extended tooltip created for AutoCAD 2009 to work with AutoCAD 2011, see To convert an AutoCAD 2009 extended tooltip to work with AutoCAD 2011.

The Stack Panel element groups the TextBlock and Image elements together. You can have as many TextBlock and Image elements under a StackPanel element that you need. The TextBlock element holds the text; the Image element holds an illustration that is part of the extended help. To learn more about XAML, visit Microsoft's web site at http://www.microsoft.com and perform a search for XAML.

See Also
Procedure
To add a tooltip to a command
To add extended help to a command
To create an XAML file
To convert an AutoCAD 2009 extended tooltip to work with AutoCAD 2011
Quick Reference
Commands
System Variables