onclick event for add-in tool ?

3301
4
01-21-2011 11:12 AM
helenchu
Occasional Contributor II
All,
What I'm trying to achive is to create a addin tool with both onclick and mousedown events.  When users click on the tool, a input box will popup, users enter a value then they click on the map to place that text on the position they want.  I could get the mousedown events fires ok but I can't seem to find the onclick event for a add-in tool.  I tried Protected Overrides Sub OnDoubleClick() nothing fires.  Thank you for your help.
0 Kudos
4 Replies
Venkata_RaoTammineni
Occasional Contributor
All,
What I'm trying to achive is to create a addin tool with both onclick and mousedown events.  When users click on the tool, a input box will popup, users enter a value then they click on the map to place that text on the position they want.  I could get the mousedown events fires ok but I can't seem to find the onclick event for a add-in tool.  I tried Protected Overrides Sub OnDoubleClick() nothing fires.  Thank you for your help.


Use BaseTool..
0 Kudos
by Anonymous User
Not applicable
Original User: KSigwart

When using the AddIn Tool, what you are looking for is the OnActivate() method.  It is essentially the same thing as the OnClick event within BaseTool or the ITool in previous versions.  When the Tool is selected in the toolbar it gets compressed and the OnActivate method is fired off.  Then when a new tool is selected, the tool is delselected and the deActivate method is fired off.
KenBuja
MVP Esteemed Contributor
Here's another way that I'm using in my add-in. I have a form (DrawFeature) containing buttons for different polygons the user can create on screen: buffered points, polygons, freehand polygons, and rectangles. I also have a tool (DrawTool) that is called when one of the buttons on that form is pushed. I'm using a global variable (DrawFeatureType) to pass what type of feature is being created.

I've attached the code since it's too long to post.
0 Kudos
by Anonymous User
Not applicable
Original User: priyanka_mehta

Hi,

I was trying your code for draw point

It gives error on select case line "Select Case Globals.DrawFeatureType"

Is there any more reference that needs to be added to identify this.

another place is  m_DrawFeature.Visible = True
what is m_DrawFeature referring to ? It is not declared in the code.

Moreover, what i am trying to do is simply trigger mouse down event through a button on form

In detail, what I want to do is ... create a point on screen and grab its XY coordinate.

On versions previous to 10, I used to do it via UI Tool control. I am really stuck with this thing here.

Any help would be appreciated.

Regards,
Priyanka
0 Kudos