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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| unit Unit5;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm5 = class(TForm)
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
LabeledEdit3: TLabeledEdit;
LabeledEdit4: TLabeledEdit;
procedure LabeledEdit1Change(Sender: TObject);
procedure LabeledEdit2Change(Sender: TObject);
procedure LabeledEdit3Change(Sender: TObject);
procedure LabeledEdit4Change(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
procedure Recherche(ZonesS: array of TLabeledEdit);
var
I: Integer;
Evt: TNotifyEvent;
Edt: TLabeledEdit;
begin
if (Length(ZonesS) = 0) then
Exit;
if Length(ZonesS) > 1 then
for I := Succ(Low(ZonesS)) to High(ZonesS) do
begin
Edt := TLabeledEdit(ZonesS[I]);
Evt := Edt.OnChange;
Edt.OnChange := nil;
Edt.Text := '';
Edt.OnChange := Evt;
end;
end;
procedure TForm5.LabeledEdit1Change(Sender: TObject);
begin
Recherche([LabeledEdit1, LabeledEdit2, LabeledEdit3, LabeledEdit4]);
end;
procedure TForm5.LabeledEdit2Change(Sender: TObject);
begin
Recherche([LabeledEdit2, LabeledEdit1, LabeledEdit3, LabeledEdit4]);
end;
procedure TForm5.LabeledEdit3Change(Sender: TObject);
begin
Recherche([LabeledEdit3, LabeledEdit2, LabeledEdit1, LabeledEdit4]);
end;
procedure TForm5.LabeledEdit4Change(Sender: TObject);
begin
Recherche([LabeledEdit4, LabeledEdit2, LabeledEdit3, LabeledEdit1]);
end;
end. |
Partager