Override draw circle selection

This is a discussion on Override draw circle selection within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi,
i wont something simple.. i dont want to load the drawing toolbar on my OCX... but i wont to ...

Override draw circle selection

Hi,
i wont something simple.. i dont want to load the drawing toolbar on my OCX... but i wont to use a button instead on my form. It's ok if the underling logic remain the same.. same event and so on... simply.. i wont that a user press my button it's like he pressed the draw circle button on the toolbar.

To do exacly same behavour is not an easy task, but I think you can do it simple if behavour is a little different. Let's think:

- User click your button, then he have to click on the map where he want the center of the shape.
- User move mouse away, shape will redraw automatically to the place where the mouse is.
- User click again, and the drawing stops.

I think this is acceptable procedure. Other approach could be drawing as long as mouse button is down, or whatever. Anyway if this kind is good for you then you can do following:

- In the button click you set a global bool drawingCircle = true;
- In the beforeClick you check drawingCircle, and if true you create the shape with diameter of 0. the Shape variable has to be global to the class of course.
- In mouseMove you check drawingCircle and calculate the distance to the center of the shape. If you have the distance then re set the diameter.
- In beforeClick you stop drawing.

It is not complete, you have to make the difference to the 2 beforeClicks, but It should give an idea I hope. What do you think ?