窗体特效,,左右移动

 

     private void timer1_Tick(object sender, EventArgs e)
        {
            int ScreenWidth = SystemInformation.PrimaryMonitorMaximizedWindowSize.Width;
            int ScreenHeight = SystemInformation.PrimaryMonitorMaximizedWindowSize.Height;
            Point MyPos = new Point(this.DesktopLocation.X, this.DesktopLocation.Y);
            if (MyPos.X + Width < ScreenWidth)
            {
                this.DesktopLocation = new Point(MyPos.X + 1, MyPos.Y);
            }
            else
            {
                this.DesktopLocation = new Point(0, MyPos.Y);
            }

        }

 

 

 

发布了29 篇原创文章 · 获赞 41 · 访问量 37万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章