我希望我的应用程序具有自动表单定位行为,类似于WinAmp MP3播放器。我希望窗户能够相互粘贴,这样如果你移动一个窗口,其他窗口就会跟随移动。我怎么能这样做?
我试过这样的事情。
if (this.Size.Width + this.Location.X >= 1270)
this.Location = new Point(1280 - this.Width, this.Location.Y); } //right x
if (this.Size.Height + this.Location.Y >= 750)
this.Location = new Point(this.Location.X, 760 - this.Width); } // bottom y
if (this.Location.X <= 5)
this.Location = new Point(0, this.Location.Y); } //left x
if (this.Location.Y <= 5)
this.Location = new Point(this.Location.X, 0); } // top y