2010-10-20 49 views

回答

4

覆蓋OnMouseClick,OnMouseDown或OnMouseUp將是最佳選擇。 MouseEventArgs類可以包含可幫助您確定按下哪個按鈕的成員。

拖動是完全不同的動物。您需要重寫OnDragEnter和OnDragDrop方法,並且您還需要在適當的時間通過調用DoDragDrop來啓動拖放操作。

0

試試這個:

private void FormA_MouseClick(object sender, MouseEventArgs e) 
     { 
      if (e.Button == MouseButtons.Left) 
      { 
      } 
      else if (e.Button == MouseButtons.Right) 
      { 
      } 
     }