Recent

Author Topic: [Anchordocking] Which event can use to detect that a form has been docked ?  (Read 2754 times)

guest58172

  • Guest
Currently I do this in the base form:

Code: Pascal  [Select][+][-]
  1. procedure TBaseForm.Resize;
  2. var
  3.   newParent: TWinControl;
  4.   site: TAnchorDockHostSite;
  5. begin
  6.   inherited;
  7.   site := DockMaster.GetAnchorSite(self);
  8.   if site.isNil then
  9.     exit;
  10.   newParent := site.Parent;
  11.   if fOldParent <> newParent then
  12.   begin
  13.     // docking changed...
  14.   end;
  15. end;

While it works, this looks a bit like a workaround: "What does happen when something is docked ? It will certainly be resized so let's override resize()".

Can you propose better ?

 

TinyPortal © 2005-2018