This document is archived and information here might be outdated. Recommended version. |
The current tool of the buddy.
[Visual Basic .NET] Public Property CurrentTool As ITool
[C#] public ITool CurrentTool {get; set;}
[C++]
HRESULT get_CurrentTool(
void
);
[C++]
HRESULT putref_CurrentTool(
);
This is a shortcut to the CurrentTool of the Buddy. The Buddy implements the IToolbarBuddy interface that has a CurrentTool property. If no Buddy is set the CurrentTool returns Nothing.
On a ToolbarControl there is only ever one CurrentTool, and this is the item that appears 'pushed in'. If another tool is selected it becomes the new CurrentTool and the previous tool is deactivated.
If multiple ToolbarControls share the same CommandPool and have the same Buddy the CurrentTool is synchronised through the Buddy so only one item on all the ToolbarControl's will be the CurrentTool.
1039 800A040F: The supplied buddy is not a supported object
Always check that the Buddy has been set, before setting the CurrentTool or the method will fail.
When the CurrentTool is set the following events occur:
Within an ITool implementation it is recommended that the ITool::Deactivate event returns true. This allows a 'new' CurrentTool to be set, and allows the release of the CurrentTool when an application is shutting down.