如题

解决方案 »

  1.   

    procedure TCustomForm.WMNCLButtonDown(var Message: TWMNCLButtonDown);
    begin
      if (Message.HitTest = HTCAPTION) and (DragKind = dkDock) and not
        (csDesigning in ComponentState) and not IsIconic(Handle) then
      begin
        { Activate window since we override WM_NCLBUTTON behavior }
        SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOZORDER or SWP_NOMOVE or
          SWP_NOSIZE);
        PostMessage(Handle, WM_NCLBUTTONUP, TMessage(Message).WParam,
          TMessage(Message).LParam);
        if Active then BeginDrag(not Floating);
      end
      else
        inherited;
    end;