Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Controls schnell auf einem Panel neu anordnen -ohne Flickern (https://www.delphipraxis.net/76234-controls-schnell-auf-einem-panel-neu-anordnen-ohne-flickern.html)

alzaimar 31. Aug 2006 17:24


Controls schnell auf einem Panel neu anordnen -ohne Flickern
 
Hi

Ich habe ein Panel, darauf sollen 50 TEdit-Controls zur Laufzeit dynamisch raufgepackt werden. Klappt ja auch, ist nur langsam.

Wenn ich vor dem Erzeugen das Panel unsichtbar mache, und hinterher wieder sichtbar, ist es schon viel schneller, flackert aber. Is klar, ich mach ja auch:
Delphi-Quellcode:
MyPanel.Visible := False;
CreateControls;
MyPanel.Visible := True;
Gibts für TPanels nicht sowas wie 'BeginUpdate'/'EndUpdate'?

Hawkeye219 31. Aug 2006 17:53

Re: Controls schnell auf einem Panel neu anordnen -ohne Flic
 
Hallo alzaimar,

Shaman zeigt in diesem Beitrag zwei Routinen als Ersatz für die API-Funktion LockWindowUpdate. Vielleicht kannst du damit ein Neuzeichnen des Panels während des Aufbaus verhindern.

Gruß Hawkeye

Zacherl 31. Aug 2006 18:02

Re: Controls schnell auf einem Panel neu anordnen -ohne Flic
 
Hier im Forum suchenDoubleBuffered

alzaimar 31. Aug 2006 19:09

Re: Controls schnell auf einem Panel neu anordnen -ohne Flic
 
:dp: Das merkt man immer wieder.
Danke an Euch!

alzaimar 1. Sep 2006 07:56

Re: Controls schnell auf einem Panel neu anordnen -ohne Flic
 
Kleiner Nachtrag:
Delphi-Quellcode:
MyPanel.Visible := False;
CreateControls;
MyPanel.Visible := True;
dauert 60ms und blinkt (Klar, Visible aus und wieder an)

Delphi-Quellcode:
LockWindow(MyPanel.Handle);
CreateControls;
UnLockWindow(MyPanel.Handle);
dauert 300ms und blinkt nicht, ist aber eigentlich kein Unterschied zum reinen 'CreateControls'.
Aber:
Delphi-Quellcode:
LockWindow(MyPanel.Handle);
MyPanel.Visible := False;
CreateControls;
MyPanel.Visible := True;
UnLockWindow(MyPanel.Handle);
dauert nur 90ms und ist somit perfekt.


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:33 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz