![]() |
NonVCL Control resizen
Hi,
Ich weiß nicht ob ich mich grad blöd anstelle, aber dann stell ich mich schon seit gestern Abend blöd an... Ich hab irgendwelche Controls STATIC,BUTTON,EDIT.. was auch immer und würde gerne die Höhe und Breite von denen ändern. Ich habs versucht mit
Delphi-Quellcode:
Aber danach ist das teil weg. Einfach nicht mehr auffindbar. Ich habs auch mit MoveWindow probiert aber das bringt auch nichts. Wobei von der Beschreibung in der SDK SetWindowPos eher das sein dürfte was ich brauche.
SetWindowPos(Handle,0,0,0,NewWidth,OldHeight,SWP_NOMOVE or SWP_NOZORDER);
Gruß Neutral General |
Re: NonVCL Control resizen
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; |
Re: NonVCL Control resizen
Hi,
Bin grad nicht zu Hause.. Werds mal nachher ausprobieren. Aber ich glaube ich hab das schon probiert und es hat nicht funktioniert. Gibts vielleicht noch andere Vorschläge? Luckie wo bist du ? :mrgreen: Gruß Neutral General |
Re: NonVCL Control resizen
Setz mal für den zweiten Parameter einen sinnvollen Wert ein, also entweder ein gültiges Fensterhandle oder eine der Konstanten.
|
Re: NonVCL Control resizen
was gibt dir GetLastError zurück?
|
Re: NonVCL Control resizen
Zitat:
|
Re: NonVCL Control resizen
Zitat:
Bei sowas wie:
Delphi-Quellcode:
Sollte man sichergehen das sowohl NewWidth als auch OldHeight >= 0 sind :wall:
SetWindowPos(Handle,0,0,0,NewWidth,OldHeight,SWP_NOMOVE or SWP_NOZORDER);
|
Re: NonVCL Control resizen
Zitat:
|
Re: NonVCL Control resizen
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:46 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz