This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IG > IGlobeControl Interface > IGlobeControl.CurrentTool Property (ArcObjects .NET 10.4 SDK) |
Current active tool for the GlobeControl. Set to nothing to clear the tool.
[Visual Basic .NET] Public Property CurrentTool As ITool
[C#] public ITool CurrentTool {get; set;}
[C++]
HRESULT get_CurrentTool(
ITool** pVal
);
[C++]
HRESULT putref_CurrentTool(
ITool* pVal
);
[C++]
Parameters pVal [out, retval]
pVal is a parameter of type ITool pVal [in]
pVal is a parameter of type ITool
The CurrentTool is the tool used to interact will the GlobeControl's display. Always check if a tool is enabled before setting it to the CurrentTool property, otherwise a user will be able to use a tool that is actually disabled.
1004 800a03ec: Current tool will not deactivate
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.
ICommand command=new ControlsGlobeZoomInOutToolClass();
command.OnCreate(axGlobeControl1.Object);
if (command.Enabled == true)
{
axGlobeControl1.CurrentTool=(ITool) command;
}
Dim pCommand As ICommand
pCommand=New ControlsGlobeZoomInOutToolClass
pCommand.OnCreate(axGlobeControl1.Object)
If pCommand.Enabled=True Then
axGlobeControl1.CurrentTool=pCommand
End If