Ejemplo n.º 1
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Down)
     {
         if (polygonDoc != null)
         {
             polygonDoc.Move(0, 5);
         }
     }
     if (e.KeyCode == Keys.Up)
     {
         if (polygonDoc != null)
         {
             polygonDoc.Move(0, -5);
         }
     }
     if (e.KeyCode == Keys.Right)
     {
         if (polygonDoc != null)
         {
             polygonDoc.Move(5, 0);
         }
     }
     if (e.KeyCode == Keys.Left)
     {
         if (polygonDoc != null)
         {
             polygonDoc.Move(-5, 0);
         }
     }
     Invalidate(true);
 }
Ejemplo n.º 2
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Left)
     {
         doc.Move(-5, 0);
     }
     else if (e.KeyCode == Keys.Right)
     {
         doc.Move(5, 0);
     }
     else if (e.KeyCode == Keys.Down)
     {
         doc.Move(0, 5);
     }
     else if (e.KeyCode == Keys.Up)
     {
         doc.Move(0, -5);
     }
     Invalidate(true);
 }
Ejemplo n.º 3
0
 private void Form1_MouseMove(object sender, MouseEventArgs e)
 {
     polygons.Move(e.Location);
     Invalidate();
 }