#region 方法一 Point first = this.Location; for (int i = 0; i < 50; i++) { Application.DoEvents(); Random ran = new Random(); Point p = new Point(this.Location.X + ran.Next(10) - 4, this.Location.Y + ran.Next(10) - 4); System.Threading.Thread.Sleep(10);…
调用WindowsAPI使窗体始终保持置顶效果,不被其他窗体遮盖: [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags); /// <summary> /// 得到当前活动的窗口 /// &…