private void btnSubtopic_Click(object sender, EventArgs e) { var a = NodeController.Get_Node_Selected(); if (a != null) { Node node = new Node(); node.Location = new Point(a.Location.X + a.Width + 50, a.Location.Y); node.RefeshMidpoint(); node.Tag = NodeController.GetNumTag(); (Parent as MainPage).Addnode(node); NodeController.Connect(a); NodeController.Connect(node); NodeController.Reefeshpaint(); (Parent as MainPage).Controls.Find("panelPaint", true).SingleOrDefault().Refresh(); } }