RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TControl.ManualFloat Method

Undocks the control.

Pascal
function ManualFloat(ScreenPos: TRect): Boolean;
C++
__fastcall Boolean ManualFloat(TRect ScreenPos);

Use ManualFloat to undock the control programmatically. 

ScreenPos is the rectangle in which the control is displayed when it starts floating.  

C++ Examples: 

 

/*
This example shows how to undock a dockable object.  This example
is part of the Docking Demo.
*/

void __fastcall TTabDockHost::FormClose(TObject *Sender, TCloseAction &Action)
{
  TRect ARect;
  TPoint point;
  if (PageControl1->DockClientCount == 1)
  {
    point =  PageControl1->DockClients[0]->ClientToScreen(Point(0, 0));
    ARect.left = point.x;
    ARect.top = point.y;
    point = PageControl1->DockClients[0]->ClientToScreen(
      Point(PageControl1->DockClients[0]->UndockWidth, PageControl1->DockClients[0]->UndockHeight));
    ARect.right = point.x;
    ARect.bottom = point.y;
    PageControl1->DockClients[0]->ManualFloat(ARect);
    Action = caFree;
  }
  else
    Action = caHide;
}

 

Delphi Examples: 

{
This example shows how to undock a dockable object.  This example
is part of the Docking Demo.
}
procedure TTabDockHost.FormClose(Sender: TObject;
  var Action: TCloseAction);
var
  ARect: TRect;
begin
  if PageControl1.DockClientCount = 1 then
  begin
    with PageControl1.DockClients[0] do
    begin
      ARect.TopLeft := ClientToScreen(Point(0, 0));
      ARect.BottomRight := ClientToScreen(Point(UndockWidth, UndockHeight));
      ManualFloat(ARect);
    end;
    Action := caFree;
  end else
    Action := caHide;
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!