日期:2014-05-18  浏览次数:21034 次

关于c#中timer和picturebox控件的使用
如何在C#中使picturebox控件根据timer控件的的改变而移动,比如让timer控件改变一秒,让 picturebox中的图像在form中移动一定的距离,谢谢~~~~~~~~

------解决方案--------------------
这个好办不知道你是要怎么移动 如果要实现这样的功能你先把picturebox的image 属性设置为你要的图像
再添加个timer控件 在他的Tick事件中加入代码如下:
public left,top;
 private void timer1_Tick(object sender, EventArgs e)
{
left+=2;//2是每次移动的距离
top+=2;
this.picturebox1.left=left;
this.picturebox1.top=top;
}
这样应该就可以了 如果不行回复我