1、用PopupMenu控件能进行右键菜单的实现,它的实现还需要绑定到barManager控件上,在barManager的Customize中添加右键所需要显示的功能。
2、PopupMenu属性栏中绑定Manager为barManager;
3、窗体加载事件中创建 this.popupMenu1.AddItems(new BarItem[] { barButtonItem1, barButtonItem2 });
4、显示右键
if (e.Button == MouseButtons.Right)
{
this.popupMenu1.ShowPopup(barManager1,new Point(this.Location.X,this.Location.Y));
}
原文:http://www.cnblogs.com/dengshiwei/p/3986051.html