示例#1
0
        private void AddTriangle_MouseDown(object sender, MouseEventArgs e)
        {
            if (firstCircle == null)
            {
                firstCircle = new Triangle(new Point(300, Height / 2 - 141), 7, null, ref destDelegate, 1, "", 0);
                treeView1.Nodes.Add(new TreeNode("1"));
                Centre_Click(null, null);
                SaveToCtrlZ();
                ChangeMenuVisible(false);
            }
            else
            {
                SaveToCtrlZ();

                if (structureComboBox1.SelectedIndex == 0)// Если выбран graph, не показываем форму для введения информации
                {
                    CreateFigure(0, "", 0, 2);
                }
                else
                {
                    addForm              = new AddNewCircle();
                    addForm.closed      += AddForm_closed;
                    addForm.AddTriangle += AddForm_AddTriangle;

                    ChangeMenuVisible(false);
                    addForm.Show();
                    addForm.Location = new Point(pictureBox1.Width / 2 + panel1.Width / 3, pictureBox1.Height / 2 - addForm.Height / 2);
                }
            }
        }
示例#2
0
 private void Change_Click(object sender, EventArgs e) // Изменить
 {
     SaveToCtrlZ();
     addForm              = new AddNewCircle();
     addForm.ChangeEvent += AddForm_Changed;
     addForm.closed      += AddForm_closed;
     ChangeMenuVisible(false);
     addForm.Show();
     addForm.Location = new Point(pictureBox1.Width / 2 + panel1.Width / 3, pictureBox1.Height / 2 - addForm.Height / 2);
 }