① 在C#编程中用键盘上的方向键来控制一张图片的移动的代码怎么写

代码如下:

void MainFormKeyDown(object sender, KeyEventArgs e)

{

int intDev = 10;

switch(e.KeyCode)

{

case Keys.Left:

Image1.Left -= intDev;

break;

case Keys.Right:

Image1.Left += intDev;

break;

case Keys.Up:

Image1.Top -= intDev;

break;

case Keys.Down:

Image1.Top += intDev;

break;

default:

break;

}

}