我只是想知道是否有人知道如何确定 TJvDockServer 表单是否容易被固定或取消固定。我能够这样做的唯一方法是通过...检查父表单是否是 TJvDockVSPopupPanel...
ancestor := GetAncestors(Self, 3);
if (ancestor is TJvDockTabHostForm) then
if ancestor.Parent <> nil then
begin
if ancestor.Parent is TJvDockVSPopupPanel then
begin
// Code here
end;
end;
和 getAncestors 是...
function GetAncestors(Control : TControl; AncestorLevel : integer) : TWinControl;
begin
if (Control = nil) or (AncestorLevel = 0) then
if Control is TWinControl then
result := (Control as TWinControl)
else
result := nil // Must be a TWinControl to be a valid parent.
else
result := GetAncestors(Control.Parent, AncestorLevel - 1);
end;