【发布时间】:2011-01-24 07:13:22
【问题描述】:
一切正常 form1+picturebox1 我可以使用下面的代码:
public Form1()
{
InitializeComponent();
KeyDown += new KeyEventHandler(Form1_KeyDown);
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
int x = pictureBox1.Location.X;
int y = pictureBox1.Location.Y;
if (e.KeyCode == Keys.Right) x += 5;
else if (e.KeyCode == Keys.Left) x -= 5;
else if (e.KeyCode == Keys.Up) y -= 5;
else if (e.KeyCode == Keys.Down) y += 5;
pictureBox1.Location = new Point(x, y);
}
但是; 如果我添加列表框来写位置图片框,我不能用箭头键移动图片框我该怎么做?
【问题讨论】:
-
只是好奇,你为什么要标记这个多线程?
-
你能解释一下关于列表框的部分吗?这不是很清楚。
标签: c# .net visual-studio multithreading