右键菜单正常设置,左键菜单不通过contextMenuStrip属性设置,在MouseClick事件里实现
C# code
private void controlID_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
contextMenuStrip1.Show(Cursor.Position);
}
}
2.右键点击不显示菜单
选择你要之前绑定ContextMenuStrip的控件,将该控件的ContextMenuStrip项设置为 无。
显示方向
Point point = new Point(mousePosition.X , MousePosition.Y);
contextMenuStrip1.Show(point, ToolStripDropDownDirection.AboveLeft);
本文参考链接:https://www.cnblogs.com/xihong2014/p/13329873.html