, , , UpdateAnchorRules. TControl FOriginalParentSize FAnchorRules . UpdateAnchorRules() Width Height FOriginalParentSize FAnchorRules.
, , .
Width - , Windows, , , Delphi 0. UpdateAnchorRules, out-of-accord 0 . .
( , Width Width - )
, UpdateAnchorRules : WinAPI CreateWindow, WM_SIZE ( WM_SIZE UpdateAnchorRules), -, CreateHandle .
, UpdateAnchorRules CreateHandle, . UpdateAnchorRules CreateHandle, , - , .
, , - , , , - ?
UpdateAnchorRules: FAnchorMove csLoading. - , , RecreateWnd, UpdateAnchorRules.
, :
type
TComponentHack = class helper for TComponent
public
procedure SetCsLoading(Value: boolean);
end;
procedure TComponentHack.SetCsLoading(Value: boolean);
var i: integer;
begin
if Value then
Self.FComponentState := Self.FComponentState + [csLoading]
else
Self.FComponentState := Self.FComponentState - [csLoading];
for i := 0 to Self.ComponentCount-1 do
if Self.Components[i] is TControl then
TControl(Self.Components[i]).SetCsLoading(Value);
end;
procedure SafeRecreateWnd();
begin
MyControl.SetCsLoading(true);
try
MyControl.RecreateWnd(); //or any operation which triggers it
finally
MyControl.SetCsLoading(false);
end;
end;
, , TControl csLoading.
UpdateAnchorRules , UpdateAnchorRules ( Delphi UpdateAnchorRules), - UpdateAnchorRules, hook.