movementClass.cs:
Add the following "using" statements:
using System.Drawing;
andusing System.Windows.Forms;
public static class movementClass
{
public static void moveLeft(PictureBox moveBox)
{
Point p = moveBox.Location;
p.X -= 20;
moveBox.Location = p;
}
public static void moveDown(PictureBox moveBox)
{
Point p = moveBox.Location;
p.Y += 20;
moveBox.Location = p;
}
}
Then in Form1.cs:
private void downBut_Click(object sender, EventArgs e)
{
movementClass.moveDown(moveBox);
}
private void leftBut_Click(object sender, EventArgs e)
{
movementClass.moveLeft(moveBox);
}