Question

How to determine in C++ Builder XE, if window is currently docked? All windows in my application are derived from base class TForm. How to catch change from docked to undocked state and vice versa?

Was it helpful?

Solution

The Form's HostDockSite property will be non-NULL when docked, an NULL otherwise.

There is no specific notification for when the HostDockSite changes, but you can override the form's virtual Dock() and/or DoDock() methods to check if the HostDockSite changes when calling the inherited methods. Alternatively, override the Form's virtual SetParent() method and check for the csDocking flag in the Form's ControlState property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top