private void Node_MouseUp(object sender, MouseEventArgs e) { if (_ball != null && _ball.IsRunning) { return; } Node ctl = (Node)sender; if (e.Button == MouseButtons.Left) { if (this.Tool == DrawingTools.Edge) { Point p2 = this.PointToClient(ctl.PointToScreen(e.Location)); Node node = this.GetChildAtPoint(p2) as Node; if (node != null) { _edges.Add(new Edge(_startIndex, node.Index)); } } Invalidate(); OnContentChanged(null, null); } }