.netcf 控件 平滑移动问题~~~
我想实现一个控件的移动,如下代码
private void button1_Click(object sender, EventArgs e) { //this.openFileDialog1.ShowDialog(); //a = this.openFileDialog1.FileName; while (true) { if (this.button2.Top < 5)//判断是否靠在窗体的最上方,如果是,给出提示 { MessageBox.Show("已到顶"); return; } else { button2.Top -= 1; } this.Update(); } }