Bonjour à tous, j'ai un petit problème, je voudrais afficher l'heure dans un label (Label1), pour faire une horloge, j'ai trouvé la solution, mais je voudrais savoir si il y a un moyen que quand je lance mon programme, l'heure s'affiche directement, car j'ai un délais avant qu'elle s'affiche. Merci pour votre aide.
Voila mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Timer1: TTimer; procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Close; end; procedure TForm1.Timer1Timer(Sender: TObject); begin Label1.Caption:= TimeToStr(now); end; end.
Je suis sous delphi 2010 architecte








Répondre avec citation






Partager