private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { switch (mode) { case Mode.ADD_BUILDING: if (curPoints.Count >= 4) { if (Math.Pow(e.X - curPoints[0].X, 2) + Math.Pow(e.Y - curPoints[0].Y, 2) <= 10) { mode = Mode.SELECT; BuildAdd add = new BuildAdd(); add.points = curPoints; add.ShowDialog(); pictureBox1.Refresh(); curPoints.Clear(); curPoints = null; return; } } curPoints.Add(new Point(e.X, e.Y)); break; case Mode.ADD_MARKER: if (isMarkerVisible) { DepEdit form = new DepEdit(); form.b = curBuilding; form.point = point; form.ShowDialog(); mode = Mode.SELECT; } break; } //DepEdit ed = new DepEdit(); //ed.point = point; //ed.ShowDialog(); //if(ed.DialogResult == DialogResult.OK) //{ // addingMode = false; //} }
private void addDep_Click(object sender, EventArgs e) { DepEdit f = new DepEdit(); f.ShowDialog(); }