怎么在click事件中区分左右键
在MouseClick事件中定义了一个右键的功能,但是单击右键时也触发Click事件,怎么解决
              
              
------解决方案--------------------Winform 鼠标右键相关处理
------解决方案--------------------你这个交互设计是有问题的,如果你非要这么做,可以再加两个事件
        private void FormTest_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                this.Click -= new EventHandler(FormTest_Click);
            }
        }
        private void FormTest_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                this.Click += new EventHandler(FormTest_Click);
            }
        }