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

Win2k SP4, WinXP Pro SP1
D6 Pers
BeitragVerfasst: Mo 20.01.03 13:06 
Ich lasse in meinem Programm die Uhrzeit als Hint anzeigen. Ich möchte aber, dass sich der Text im Hint auch jede Sekunde aktualisiert und nicht statisch bleibt.
Ich habe bereits Application.HintPause:=1; gesetzt, auch mit HintHidePause und HintShortPause habe schon ohne Erfolg "herumexperimentiert".
Natürlich weise ich dem Hint jede halbe Sekunde die neue Uhrzeit zu, was aber keinen Effekt zeigt.

Meine Frage also: Wie mache ich den Text eines Hint dynamisch?
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 20.01.03 17:25 
Benutz dazu mal einen Timer mit dem Intervall 1 Sekunde:

ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.TimerTimer(Sender: TObject);
begin
  Form1.Hint := TimeToStr(Time);
end;


Damit wird alle 1 Sekunde der Text in deinem Hint auf die aktuelle Zeit gesetzt.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 20.01.03 17:27 
ich glaube er will, das der hint die ganze zeit angezeigt wird, und gleichzeitig aktualisiert wird.
deine methode verändert nur dern text in dem hint, wenn er neu gezeichnet wird
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 20.01.03 17:52 
@torsten:
Da hast du recht, mein Programm ändert bloß jede Sekunde den Hint.

@Dargor:
Willst du jede Skeunde bloß den Hint ändern, oder auch den Hint anzeigen?

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 20.01.03 17:55 
bei dragor wird nur der wert des hinttextes geändert, aber er wird nicht angezeigt, erst, wenn man neu über ein objekt geht und der hint wieder erscheint
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 20.01.03 18:19 
Das ist nunmal genau das, was meine Codezeile auch macht.


Also ich habe mir mal eine StatusBar in den ComCtrls angesehen, denn die hat die einzige dynamischen Hints. Schau dir dort mal die folgende procedure an:

ausblenden Quelltext
1:
procedure TCustomStatusBar.UpdatePanel(Index: Integer; Repaint: Boolean);					


©Borland

Ich glaube, wenn du daraus einige Anregungen hohlst kannst du deinen Hint dynamisch machen.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.