My application has a standard MenuStrip on top of the window and a
ContextMenuStrip that pops up when the user clicks the right mouse button.
I have defined a ToolStripMenuItem that I want to appear on both the
MenuStrip and the ContextMenuStrip, but any attempt to do so makes the
ToolStripMenuItem silently disappear from the other menu.
See this little program:
using System.Windows.Forms;
class Form1:Form
{
Form1()
{
ToolStripMenuItem one=new ToolStripMenuItem("one");
ToolStripMenuItem two=new ToolStripMenuItem("two");
ToolStripMenuItem three=new ToolStripMenuItem("three");
MenuStrip menustrip=new MenuStrip();
menustrip.Items.AddRange(new ToolStripItem[]{one,two,three});
Controls.Add(menustrip);
ContextMenuStrip=new ContextMenuStrip();
ContextMenuStrip.Items.Add(two);
}
static void Main()
{
System.Windows.Forms.Application.Run(new Form1());
}
}