예제 #1
0
 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();
 }
예제 #2
0
 public void ClickEvent(Object sender, ModifiedEventArgs modifiedEventArgs)
 {
     if (this.events != null)
     {
         events.Invoke(sender, modifiedEventArgs);
     }
     else
     {
         MessageBox.Show("Вы не открыли окна для рисования", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }