public void FireNodeActivated() { if (NodeActivated != null) { NodeActivated.Invoke(this); } }
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); }
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)); } } }