if DocktoForm then begin Form2.Left := Form1.Left - (F1X-F2X);// + (X-OldX); Form2.Top := Form1.Top+Form1.Height; exit; end; //This section latches playlist in center of Form1 if (Form2.Left > Form1.Left + ((Form1.Width div 2)-(Form2.Width div 2))-10) and (Form2.Left < Form1.Left + ((Form1.Width div 2)-(Form2.Width div 2))+10) and (Form2.Top > Form1.Top+Form1.Height-10) and (Form2.Top < Form1.Top+Form1.Height+10) then begin Form2.Left := Form1.Left + ((Form1.Width div 2)-(Form2.Width div 2)); DocktoForm := True; F1X := Form1.Left; F1Y := Form1.Top; F2X := Form2.Left; F2Y := Form2.Top; end; end; end; procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin CanMove := false; end; procedure TForm1.FormShow(Sender: TObject); begin //Get Work Area Parameters SystemParametersInfo(SPI_GETWORKAREA, 0, @WorkArea, 0 ); Form2.Show; end; end. |
正在阅读:Delphi中的窗体移动Delphi中的窗体移动
2004-03-31 10:17
出处:delphi精髓网
责任编辑:sdq
键盘也能翻页,试试“← →”键