//This section latches to the right side if (Form1.Left > WorkArea.Right-Form1.Width-10) and (Form1.Left < WorkArea.Right-Form1.Width+10) then begin Form1.Left := WorkArea.Right-Form1.Width; if (X-OldX > 10) or (X-OldX < -10) then CanMoveX := true else CanMoveX := False; end; //This section latches to the TaskBar if DocktoForm then begin if (Form1.Top > WorkArea.Bottom-Form1.Height-Form2.Height-10) and (Form1.Top < WorkArea.Bottom-Form1.Height-Form2.Height+10) then begin Form1.Top := WorkArea.Bottom-Form1.Height-Form2.Height; if (Y-OldY > 10) or (Y-OldY < -10) then CanMoveY := true else CanMoveY := False; end; end else begin if (Form1.Top > WorkArea.Bottom-Form1.Height-10) and (Form1.Top < WorkArea.Bottom-Form1.Height+10) then begin Form1.Top := WorkArea.Bottom-Form1.Height; if (Y-OldY > 10) or (Y-OldY < -10) then CanMoveY := true else CanMoveY := False; end; end; |
正在阅读:Delphi中的窗体移动Delphi中的窗体移动
2004-03-31 10:17
出处:delphi精髓网
责任编辑:sdq
键盘也能翻页,试试“← →”键