GUI/MainForm.cs
changeset 288 a35a89a35532
parent 287 1f5cf5d533e6
child 291 61c3d984fb2d
     1.1 --- a/GUI/MainForm.cs	Sun May 15 20:48:52 2011 +0000
     1.2 +++ b/GUI/MainForm.cs	Sun May 15 21:43:40 2011 +0000
     1.3 @@ -76,6 +76,8 @@
     1.4  
     1.5      private WmiProvider wmiProvider;
     1.6  
     1.7 +    private bool selectionDragging = false;
     1.8 +
     1.9      public MainForm() {      
    1.10        InitializeComponent();
    1.11  
    1.12 @@ -629,9 +631,19 @@
    1.13      }
    1.14  
    1.15      private void treeView_MouseMove(object sender, MouseEventArgs e) {
    1.16 -      if ((e.Button & (MouseButtons.Left | MouseButtons.Right)) > 0) {
    1.17 -        treeView.SelectedNode = treeView.GetNodeAt(e.Location);
    1.18 -      }
    1.19 +      selectionDragging = selectionDragging &
    1.20 +        (e.Button & (MouseButtons.Left | MouseButtons.Right)) > 0; 
    1.21 +
    1.22 +      if (selectionDragging)
    1.23 +        treeView.SelectedNode = treeView.GetNodeAt(e.Location);     
    1.24 +    }
    1.25 +
    1.26 +    private void treeView_MouseDown(object sender, MouseEventArgs e) {
    1.27 +      selectionDragging = true;
    1.28 +    }
    1.29 +
    1.30 +    private void treeView_MouseUp(object sender, MouseEventArgs e) {
    1.31 +      selectionDragging = false;
    1.32      }
    1.33    }
    1.34  }