private void ClickButtonEventForm4(object sender, ModifiedEventArgs modifiedEventArgs) { textBox1.Text = modifiedEventArgs.XLeftUp.ToString(); textBox2.Text = modifiedEventArgs.YLeftUp.ToString(); textBox3.Text = modifiedEventArgs.XRightDown.ToString(); textBox4.Text = modifiedEventArgs.YRightDown.ToString(); }
public void ClickEvent(Object sender, ModifiedEventArgs modifiedEventArgs) { if (this.events != null) { events.Invoke(sender, modifiedEventArgs); } else { MessageBox.Show("Вы не открыли окна для рисования", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private static void ClickButtonEventForm3(object sender, ModifiedEventArgs modifiedEventArgs) { Graphics g = panel.CreateGraphics(); SolidBrush brush = new SolidBrush(Color.LightGray); g.FillRectangle(brush, 0, 0, 590, 337); brush = new SolidBrush(Color.Red); g.FillEllipse(brush, modifiedEventArgs.XLeftUp, modifiedEventArgs.YLeftUp, modifiedEventArgs.XRightDown - modifiedEventArgs.XLeftUp, modifiedEventArgs.YRightDown - modifiedEventArgs.YLeftUp); }
private void ClickButtonEventForm2(object sender, ModifiedEventArgs modifiedEventArgs) { Graphics g = panel.CreateGraphics(); SolidBrush brush = new SolidBrush(Color.LightGray); g.FillRectangle(brush, 0, 0, 590, 337); brush = new SolidBrush(Color.Red); int[] coord = { modifiedEventArgs.XLeftUp, modifiedEventArgs.YLeftUp, modifiedEventArgs.XRightDown, modifiedEventArgs.YRightDown }; var texts = coord.Select(x => x); Text = "Main Form "; Text += string.Join(" ", texts); g.FillRectangle(brush, modifiedEventArgs.XLeftUp, modifiedEventArgs.YLeftUp, modifiedEventArgs.XRightDown - modifiedEventArgs.XLeftUp, modifiedEventArgs.YRightDown - modifiedEventArgs.YLeftUp); }