Exemple #1
0
 public void FireNodeActivated()
 {
     if (NodeActivated != null)
     {
         NodeActivated.Invoke(this);
     }
 }
Exemple #2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space)
            {
                if (SelectedNode != null)
                {
                    NodeActivated.Invoke(this, new TreeViewExEventArgs(SelectedNode, TreeViewAction.ByKeyboard));

                    e.Handled          = true;
                    e.SuppressKeyPress = true;

                    return;
                }
            }

            base.OnKeyDown(e);
        }
Exemple #3
0
        protected override void OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
        {
            base.OnNodeMouseDoubleClick(e);

            TreeViewHitTestInfo hitTest = this.HitTest(e.Location);

            if (hitTest.Node != e.Node)
            {
                return;
            }

            if (e.Button == MouseButtons.Left)
            {
                if (hitTest.Location == TreeViewHitTestLocations.Label)
                {
                    NodeActivated.Invoke(this, new TreeViewExEventArgs(e.Node, e));
                }
            }
        }