private void manualBtn_Click(object sender, EventArgs e) { stressFlowPoint1 = null; stressFlowPoint2 = null; clear(); Task.Delay(500); form.Focus(); form.BringToFront(); form.yieldPoints = null; string coord = ""; if (!((form.SelectionCurveBegin == null) && (form.SelectionCurveEnd == null))) { form.yieldPoints = new PointPair[2]; if (form.SelectionCurveBegin != null) { coord += ("Точка 1 с координатами {" + form.SelectionCurveBegin.Points[0].X + "," + form.SelectionCurveBegin.Points[0].Y + "}"); form.yieldPoints[0] = form.SelectionCurveBegin.Points[0]; } if (form.SelectionCurveEnd != null) { coord += ("Точка 2 с координатами {" + form.SelectionCurveEnd.Points[0].X + "," + form.SelectionCurveEnd.Points[0].Y + "}"); form.yieldPoints[1] = form.SelectionCurveEnd.Points[0]; } } else { coord = "ничего"; MessageBox.Show("Выберите хотя бы одну точку и нажмите Enter"); } msgLbl.Text = "Вы выбрали " + coord + ". Вас устраивает выбор?"; if (form.yieldPoints != null && form.yieldPoints[0] != null) { stressFlowPoint1 = new PointPair(form.yieldPoints[0].X, form.yieldPoints[0].Y); } if (form.yieldPoints != null && form.yieldPoints[1] != null) { stressFlowPoint2 = new PointPair(form.yieldPoints[1].X, form.yieldPoints[1].Y); } }