Registriert seit: 15. Feb 2004
Ort: Göppingen
270 Beiträge
Delphi XE5 Professional
|
Re: NonVCL Control resizen
5. Okt 2007, 08:27
Hallo
Ausschnitt aus "controls.pas", eventuell kannst das verwenden, bzw. das was du brauchst rauslesen ...
Delphi-Quellcode:
procedure TWinControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var
WindowPlacement: TWindowPlacement;
begin
if (ALeft <> FLeft) or (ATop <> FTop) or
(AWidth <> FWidth) or (AHeight <> FHeight) then
begin
if HandleAllocated and not IsIconic(FHandle) then
SetWindowPos(FHandle, 0, ALeft, ATop, AWidth, AHeight,
SWP_NOZORDER + SWP_NOACTIVATE)
else
begin
FLeft := ALeft;
FTop := ATop;
FWidth := AWidth;
FHeight := AHeight;
if HandleAllocated then
begin
WindowPlacement.Length := SizeOf(WindowPlacement);
GetWindowPlacement(FHandle, @WindowPlacement);
WindowPlacement.rcNormalPosition := BoundsRect;
SetWindowPlacement(FHandle, @WindowPlacement);
end;
end;
UpdateAnchorRules;
UpdateExplicitBounds;
RequestAlign;
end;
end;
Peter Schaible
|
|
Zitat
|