is there any way to zoom using scroll wheel ? i have tried AutoMouseWheel of map control, it works well for the first used custom tool, but once i change the tool, it stops working , i would like to know the reason of this weird behavior.

i don't know if it is possible to catch mouse wheel events in custom tool ? that's seems to be an alternative solution.

Any suggestion or help is welcome :)


The reason is, because mouse wheel event is enabled for only activated window (focused window). So, when you press the tool, then MapControl lost focus and the tool command (window) will get focus. Here the sample how to set focus on MapControl when you activate the custom tool.

static extern IntPtr SetFocus(IntPtr hWnd);

/// <summary>
/// Occurs when this tool is clicked
/// </summary>
public override void OnClick() {
    // TODO: Add Tool1.OnClick implementation
    IActiveView pActiveView =  m_hookHelper.ActiveView;

A custom tool using IDisplayFeedback Interface might help you for panning and zooming while editing your feature. Code sample: ArcGIS snippet for Panning and Zooming while editing using C#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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