This project is read-only.

SharpContextMenu called twice

Mar 20, 2014 at 10:16 PM
Hi All,

I came across a very strange behavior of SharpContextMenu.

Constructor and CanShowMenu method are being called twice when I do mouse right button click on the directory tree in Windows 7 (left side panel of the windows explorer).

In the result it generates context menu twice.

Is this a bug?

Mar 20, 2014 at 10:19 PM
Sample code:
[COMServerAssociation(AssociationType.Class, @"Directory\Background")]
public class DirectoryContextMenu : SharpContextMenu
    public DirectoryContextMenu()

    protected override bool CanShowMenu()

        return false;

    protected override System.Windows.Forms.ContextMenuStrip CreateMenu()
        ContextMenuStrip contextMenuStrip = new ContextMenuStrip();

        return contextMenuStrip;
Mar 24, 2014 at 10:52 AM

I'll look into this for the next release and let you know when I've discovered what's going on :)