winform 右键单击事件

 1 private void Form1_MouseClick(object sender, MouseEventArgs e)  
2 {
3 if (e.Button == MouseButtons.Left && e.Clicks == 1)
4 {
5 this.label1.Text = "您单击了鼠标左键!";
6 }
7 else if (e.Button == MouseButtons.Right && e.Clicks == 1)
8 {
9 this.label1.Text = "您单击了鼠标右键!";
10 }
11 }


posted @ 2012-01-16 14:47  kumat  阅读(1111)  评论(1编辑  收藏  举报