正在阅读:Delphi中的窗体移动Delphi中的窗体移动

2004-03-31 10:17 出处:delphi精髓网 作者:delphi精髓 责任编辑:sdq

            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.

察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品