Autor Beitrag
Dargor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 59

Win2k SP4, WinXP Pro SP1
D6 Pers
BeitragVerfasst: Mo 06.06.05 08:47 
Mein Programm besteht aus 2 Formularen. Das 2. öffnet sich bei einem Klick auf einen Button im Hauptformular und zeigt in einem StringGrid eine Auflistung aller Prozesse (analog TaskManager) an.
Beim Auflisten lasse ich die Caption des 2. Formulars, welches auch aktiv ist, dynamisch ändern (bzw. will ich diese ändern lassen), indem die Anzahl der Prozesse angezeigt wird:

ausblenden Quelltext
1:
Form2.Caption:='Prozesse: '+IntToStr(count);					


Count ist dabei eine Variable, die die Anzahl der Prozesse mitzählt.
Allerdings bleibt die gesamte Titelleiste leer - erst nachdem ich irgendwo außerhalb des 2. Formulars klicke, und das 2. Formular innaktiv wird, wird die Caption angezeigt. Auch ein Form2.Refresh oder Form2.Repaint hat nicht funktioniert.

Wieso wird die Caption nicht ordentlich angezeigt? Kann die Caption nicht so schnell hintereinander geändert werden, oder woran liegt das?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 06.06.05 10:08 
Hallo,

laut deiner Programmbeschreibung dürfte es eigentlich keine Probleme geben.
Du könntest mal in die Schleife Application.ProcessMessages; einbauen.
Mit etwas mehr Code könnte man eher genaueres dazu sagen.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Dargor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 59

Win2k SP4, WinXP Pro SP1
D6 Pers
BeitragVerfasst: Di 07.06.05 06:50 
Application.ProcessMessages habe ich auch schon probiert.
Ich habe auch schon versucht, die Caption erst am Ende der Schleife zu ändern (sogar ohne das IntToStr(count)) - auch ohne Erfolg.

Liegt es vielleicht daran, dass ich Form2.BorderStyle:=bsDialog und/oder Form2.WindowState:=wsStayOnTop gesetzt habe?

Den Quellcode habe ich jetzt gerade leider nicht, da ich auf Arbeit bin - werde ich aber morgen mal posten.