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.

  • Did you try calling ICommand.OnClick too? Commented Nov 4, 2015 at 19:42
  • Its called automatically when I click on the button on the Bar
    – raed
    Commented Nov 4, 2015 at 19:58
  • See also gis.stackexchange.com/a/8513/59 Commented Nov 4, 2015 at 20:00
  • Its the link I posted above :p
    – raed
    Commented Nov 4, 2015 at 20:02

1 Answer 1


Actually, All I had to do is to refresh the Tool:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.