Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to implement moving a point feature in a custom C# ArcGIS Engine application on an AxMapControl. I've already created a custom tool to do some other things. And I can track when the user is doing a drag-type operation (i.e. click and hold while moving the mouse).

What I'd like to be able to do is give some visual feedback of the drag operation, but I'm not sure how to do that.

I can handle the feature selection, identifying the drag, and getting the new position, etc. Just need help specifically with the drag feedback. Ideally I would like to update the cursor to have the same symbology as the feature, but that's not an absolute requirement.

share|improve this question
What about IDisplayFeedback – Chad Cooper Aug 23 '11 at 20:57
up vote 10 down vote accepted

The trick to feedback is setting ISymbol.ROP to esriROPNotXOrPen and drawing the geometry twice, the first draw displays it, the second draw erases it. Be sure if you're using a multilayer symbol to set the ROP for each layer.

public class MyTool : ESRI.ArcGIS.Desktop.AddIns.Tool

    private ISymbol m_Symbol;
    private IPoint m_lastPoint;
    private bool m_Dragging = false;
    public MyTool()
        m_Symbol = new SimpleMarkerSymbolClass();
        ((ISimpleMarkerSymbol)m_Symbol).Size = 20.0;
        m_Symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; 

    protected override void OnUpdate()

    protected override void OnMouseDown(Tool.MouseEventArgs arg)
        m_Dragging = !m_Dragging;
        if (!m_Dragging)
            Draw(arg.X, arg.Y);

    protected override void OnMouseMove(Tool.MouseEventArgs arg)
            Draw(arg.X, arg.Y);

    private void Draw(int X, int Y)
        var av = ArcMap.Document.FocusMap as IActiveView;
        var pnt = av.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
        av.ScreenDisplay.StartDrawing(av.ScreenDisplay.hDC, 0);
        if(m_lastPoint != null)
        if (m_Dragging)
            m_lastPoint = pnt;
            m_lastPoint = null;

    protected override bool OnDeactivate()
        // todo
        return base.OnDeactivate();
share|improve this answer
Awesome, thanks! Also, for anyone interested, here is a link that shows how to use a bitmap for the drag symbol:… – Keith G Aug 24 '11 at 14:34

Your Answer


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.