Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 C++ Builder XE 中确定窗口当前是否停靠?我的应用程序中的所有窗口都派生自基类 TForm。如何捕捉从停靠状态到非停靠状态的变化,反之亦然?
停靠时窗体的HostDockSite属性将为非,否则为非。NULLNULL
HostDockSite
NULL
更改时没有具体通知HostDockSite,但您可以覆盖表单的虚拟Dock()和/或DoDock()方法以检查HostDockSite调用继承方法时是否更改。或者,覆盖 Form 的虚拟SetParent()方法并检查Form属性csDocking中的标志。ControlState
Dock()
DoDock()
SetParent()
csDocking
ControlState