Les Snippets

Connexion

Mise à jour d'un Hint en continu.

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 28/10/2007 21:17:06 et initié par Caribensila [Liste]
Vue : 1205
Catégorie(s) : Date & Heure, Trucs & Astuces, Divers, Control
Langages dispo pour ce code :
- Delphi 5



Langage : Delphi 5
Date ajout : 28/10/2007
Posté par Caribensila [Liste]


procedure TForm1.FormCreate(Sender: TObject);
  begin
  Application.OnShowHint := DoShowHint;
end;


{Le Hint du Label1 affichera l'heure en continu.}
procedure TForm1.DoShowHint(var HintStr: String ; var CanShow: Boolean;
                                          var HintInfo: THintInfo);
  begin
  if HintInfo.HintControl = Label1 then begin
     HintInfo.ReshowTimeout := 1000; // Périodicité de la màj.
     Label1.Hint := TimeToStr( Time ); // Affiche l'heure par exemple.
  end;
end;


Remarque :
Label1.ShowHint à true.