RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TControl.UndockHeight Property

Specifies the height of the control when it is floating.

Pascal
property UndockHeight: Integer;
C++
__property int UndockHeight;

Read UndockHeight to get the height of the control from the last time it was floating. Set UndockHeight to indicate the height the control should have the next time it is undocked. 

UndockHeight allows a control to "remember" its floating size even when its height changes because it is docked.  

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!