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

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

            //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;

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

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

相关文章

关注我们

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