Bonjour,

j'ai cette procédure

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
41
42
43
44
45
46
47
48
49
 
//===================================================================
procedure Taffiche.FormKeyPress(Sender: TObject; var Key: Char);
var
nb_lig,i,fl: integer;
recher: string;
 
begin
if (Key=Char(VK_RETURN )) and (edit1.text<>'') then
begin
Key := #0;
efface;
    try
       seek(fichier,0); read(fichier,enregcollec);
   except
       ShowMessage('Aucune collection ouverte');
       Exit;
    end;
 
           fl:=0;
           nb_lig:=enregcollec.index;
           recher:=Lowercase(trim(Edit1.text));
           if length(recher)=0 then
           begin
           ShowMessage('Aucun numéro sélectionné.');
           exit;
           end;
           for i:=1 to nb_lig do
            begin
               seek(fichier,i); read(fichier,enregcollec);
 
                if recher=Lowercase(trim(enregcollec.num)) then
                        begin
                            index_cour:=enregcollec.index;fl:=1;
                            Break;
                        end;
            end;
 
 if fl=0 then  ShowMessage('Recherche infructueuse !!.');
 
end;// if KeyPress = 13
 
if Key=Char(VK_F2)  then
begin
Key := #0;
fich_suiv;
end;  
 
end;
lorsque je presse la touche "Tab" ça marche, mai lorsque je presse la touche "F2" il ne se passe rien et aucun message d'erreur

Merci de votre aide