wpf 与winform获取鼠标左右键焦点的差异

  1. winform中以Panel为例的MouseDown事件为:
    private void panelposition_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
          //判断鼠标左键按下
          if(e.Button == System.Windows.Forms.MouseButtons.Left){//...}
           //判断鼠标左键按下
          if(e.Button == System.Windows.Forms.MouseButtons.Right){//...}
    }
  2. wpf中以Image为例的MouseDown事件为:
    private void imageposition_MouseDown(object sender, MouseButtonEventArgs e)
    {
            //判断鼠标左键按下
          if(e.LeftButton == MouseButtonState.Pressed){//...}
           //判断鼠标左键按下
          if(e.RightButton == MouseButtonState.Pressed){//...}
    }

 

posted @ 2012-02-13 15:42  帕丁顿熊  阅读(1616)  评论(0编辑  收藏  举报