private void DrawGroup_Click(object sender, EventArgs e) //Выбираем группу { if (toolStripComboBox1.SelectedIndex == -1) { return; } tl = tools[toolStripComboBox1.SelectedIndex + 3]; toolsJob = paintFigure; }
formTools toolsJob; //Создаём переменную делегата чтобы заносить в неё методы для отработки private void Form1_Load(object sender, EventArgs e) { gr = pictureBox1.CreateGraphics(); tl = null; tools.Add(null); tools.Add(new Rect.RectCreator()); tools.Add(new Elips.ElipsCreator()); toolsJob = selectFigure; select = new FigureSelect(); }
private void Circle_Click(object sender, EventArgs e) { tl = tools[2]; toolsJob = paintFigure; }
private void Rect_Click(object sender, EventArgs e) { tl = tools[1]; toolsJob = paintFigure; }
private void Move_Click(object sender, EventArgs e) { tl = null; toolsJob = selectFigure; }