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));
}
时间: 2024-11-14 18:43:12