Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'd like to use some of the standard 'out of the box' esri tools e.g. Measure Tool in an ArcEngine app, but I'd like to change the default bitmap of the tool button. Any suggestions would be gratefully received.

share|improve this question
add comment

1 Answer

I don't think inheriting the measuretool and overriding ICommand.Bitmap will work, but haven't tried it lately.

So instead, you might try creating a new tool (MyMeasureTool), and use containment, with a contained member variable for the tool whose bitmap you want to change. Instantiate the contained command/tool in ICommand.OnCreate. Forward all ICommand and ITool methods to the contained command, except for ICommand.Bitmap for which you'll return a handle to your preferred bitmap.

share|improve this answer
    
Thanks Kirk. Having gone through the documentation in more depth, link I'm not sure if it might be easier to avoid using the ToolbarControl, and just create my own buttons to run the esri controls. However, I will try out your suggestion. –  DJT Jul 11 '11 at 8:30
    
Buttons are certainly an easy replacement for Commands, but for Tools (which implement ITool) it gets a bit more complicated. –  Kirk Kuykendall Jul 11 '11 at 14:45
    
I've created a new tool using the containment method you suggested based on the measure tool. It works OK until I click on one of the measure pop up window buttons, to say, measure areas rather than lines. When I do this it creates another measure window, and if I have the original esri measure tool in the toolbar, it becomes the active tool. As far as I can tell, clicking one of the buttons causes the tool to check to see if there's an instance of the measure tool in the map, and if not, create one, presumably using the original esri GUID. Not sure how to get around this. –  DJT Jul 18 '11 at 13:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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