Copying a ToolStripMenuItem

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?

--
 
A

Andrue Cope

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

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

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top