日期:2014-05-16  浏览次数:20867 次

菜鸟求助,一个关于label移动的问题
这个是我的代码
这个是我的页面
每按一次BUTTON,label就移动,到了尽头就回去,但是我这个不能回头也
求助
------解决方案--------------------

 bool moveBottom = true;
        private void button1_Click(object sender, EventArgs e)
        {
            if (moveBottom)
            {
                label1.Top += 50;
                if (label1.Top > this.Height)
                    moveBottom = false;
            }
            else
            {
                label1.Top -= 50;
                if (label1.Top < 0)
                    moveBottom = true;
            }
        }



左右移动的仿着写写