if (this.MainToolStripMenuItem.DropDownItems.Count > 0)
{
ToolStrip target = this.MainToolStripMenuItem.DropDownItems[this.MainToolStripMenuItem.DropDownItems.Count-1].GetCurrentParent();
ToolStrip sourse = this.contextMenuStrip1;
bool b = ToolStripManager.Merge(sourse, target);
}我是通过这个将contextMenuStrip1合并到MainToolStripMenuItem主菜单中,但是在我合并后contextMenuStrip1中的项确都移除掉,请问各位有什么方法呢?
{
ToolStrip target = this.MainToolStripMenuItem.DropDownItems[this.MainToolStripMenuItem.DropDownItems.Count-1].GetCurrentParent();
ToolStrip sourse = this.contextMenuStrip1;
bool b = ToolStripManager.Merge(sourse, target);
}我是通过这个将contextMenuStrip1合并到MainToolStripMenuItem主菜单中,但是在我合并后contextMenuStrip1中的项确都移除掉,请问各位有什么方法呢?
ContextMenuStrip c2 = this.contextMenuStrip1;
我实例化两个ContextMenuStrip ,照这样说(c1,c2)应该互相不影响,但是在
ToolStrip sourse = c1;
bool b = ToolStripManager.Merge(sourse, target);
在这边执行后还是会将c2清空,
请问有什么方法吗?