Copying a ToolStripMenuItem

  • Thread starter Thread starter Andrue Cope
  • Start date Start date
A

Andrue Cope

Hi,

I'm implementing a plug-in interface and I want to allow plug-ins to
add menu items to the host application's menu bar. I've given them a
public method that is passed a ToolStripMenuItem but it seems that you
can't /copy/ these things. You can only move them.

At present plug-in developers can add menu items by writing code but
that's a bit unpleasant. What I want is to allow them to implement
their menus using the IDE designer then just have a function to copy
them onto the parent menu. Oh and the copying needs to be on demand so
that the host menu changes as a plug-in gets focus.

Any thoughts?

--
 
Hah! I found it. Typical really after posting here :)

The answer is ToolStripManager.RevertMerge() and
ToolStripManager.Merge(). Slightly obscure but works a treat.

--
 
Back
Top