Thema: Delphi Panel - Farbe wechseln

Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#9

Re: Panel - Farbe wechseln

  Alt 28. Sep 2009, 13:42
Ich hab ja gesagt du sollst es so machen:

Delphi-Quellcode:
procedure TForm5.Panel11Click(Sender: TObject);
begin
  Panel11.Color := RGB(195,195,195);
  Application.ProcessMessages;
  sleep(10); // mal etwas mehr
  Panel11.Color := clWhite;
end;
Das Programm kommt sonst nicht dazu das Fenster neu zu malen bevor sleep ausgeführt wird und man sieht nichts von der Farbänderung.

Edit: Delay ist quasi ein Sleep mit eingebautem Application.ProcessMessages
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat