Quantcast
Channel: Question and Answer » arcobjects
Viewing all articles
Browse latest Browse all 66

Activate / Deactivate customized ITool from Form in ArcObjects?

$
0
0

I’m using ArcGIS 9.3/VB6, and I have a little issue with the activation of a custom Tool:

I have a Class, that implements both ICommand and ITool

When I click on ICommand, the form is launched
First, The CurrentTool is deactivated

Set Application.CurrentTool = Nothing

Then I need to activate the ITool, so I click on a button, I get my tool UID, and :

Dim pSelectedTool As ICommandItem
Dim pCommandBars As ICommandBars
Dim pApp As IApplication

Set pCommandBars = pApp.Document.CommandBars
Set pSelectedTool = pCommandBars.Find(pUID)
Set pApp.CurrentTool = pSelectedTool

The pApp.CurrentTool.Name contain the name of my ITool, but the problem is that the Tool is still deactivated, when I click on the Map nothing happen!

I found a question similar to mine, but with no help.


Viewing all articles
Browse latest Browse all 66