RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWinControl.DockClients Property

Lists the controls that are docked to the windowed control.

Pascal
property DockClients [Index: Integer]: TControl;
C++
__property TControl * DockClients[int Index];

Use DockClients to access any control that is docked to the windowed control.  

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: 

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) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!