Fórum Qdo o usr terminar de digitar o código (4 caracteres).... #144383
11/03/2003
0
Como posso fazer?
Debora
Curtir tópico
+ 0Posts
11/03/2003
Poeta Noturno
if lenght(edit1.text) = 4 then
edit2.setfocus;
Um abraço
Poeta Noturno
Gostei + 0
11/03/2003
Debora
Gostei + 0
11/03/2003
Desander
edite o maxlength do edit1 para 4.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x: integer;
implementation
{$R *.DFM}
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Edit1.Text = ´´ then x:=0;
x:= x + 1;
if Edit1.MaxLength = x then
Edit2.setFocus;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
x:= 0;
end;
end.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)