I need to remake this,so when the text is same in both edits 1 and 2 , text in both edits should be at first red and then edits should be invisible,or when text is not same text in both edits should be red and then white.Please help me
procedure TForm1.Edit1Click(Sender: TObject);
begin
edit1.Font.Color:=clred;
if ((edit2.font.color=clred) and (edit1.text = edit2.text)) then
begin
edit2.visible:=false;
edit1.visible:=false;
end ;
if ((edit2.font.color =clred) and (edit1.text <> edit2.text)) then
begin
edit1.font.color:=clwhite;
edit2.font.color:=clwhite;
end;
end;
procedure TForm1.Edit2Click(Sender: TObject);
begin
edit2.Font.Color:=clred;
if ((edit1.font.color=clred) and (edit1.text = edit2.text)) then
begin
edit1.visible:=false;
edit2.visible:=false;
end;
if ((edit1.font.color =clred) and (edit1.text <> edit2.text)) then
begin
edit2.font.color:=clwhite;
edit1.font.color:=clwhite;
end;
end;
end.