Bonjour à toutes et à tous,
J'utilise un Tbutton à deux états sur ma fiche, un état pour fermer ma fiche avec "Application.minimize" et activer un timer et l'autre pour stopper le timer mais je dois cliquer sur la fiche qui se trouve dans la barre de tache pour la restaurer et appuyer sur le bouton "STOP".
Serait t'il possible avec la touche "Escape" de rendre à ma fiche son état windowState := wsnormal pour me permettre d'appuyer sur ce bouton "STOP" ou de le faire en même temps.
J'ai essayé plusieures possibilités avec la touche VK_ESCAPE sans résultat.
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 procedure TFenregistre.BfilmerClick(Sender: TObject); begin if Bfilmer.Caption<>'Stop' then begin Application.minimize; memo1.Clear; Bfilmer.Caption:='Stop'; timer1.Enabled:=true; end; end else begin {if Key = VK_ESCAPE then windowState := wsnormal; } timer1.Enabled:=false; Bfilmer.Caption:='Filmer'; windowState := wsnormal; Application.ProcessMessages; end; end;
Même en mettant KeyPreview à true.
Merci d'avance,
@+,
Cincap
Partager