Edit mudar foco direto

Delphi

14/09/2005

voces poderiam me ajudar a fazer o edit mudar o foco direto ?

vou explicar...

Tenho um edit (Ex. Edit1) que só Aceita 3 caracteres, eu queria que ao termino que o usuario digitou os 3 caracteres ele iria para o proximo edit.

alguem poderia me ajudar ?


Fernando_cunha

Fernando_cunha

Curtidas 0

Respostas

00seth

00seth

14/09/2005

tente assim

no evento onkeypress do edit, faça:

if length(edit1.text ) = 3 then
edit2.setfocus;


GOSTEI 0
Rjun

Rjun

14/09/2005

Coloque o código abaixo no evento OnChange.

if Length(Edit1.Text) >= 3 then
  Edit2.SetFocus;



GOSTEI 0
Michelli88

Michelli88

14/09/2005

Evento OnKeyPress

 if Length(Edit1.Text) = 2 then
  Edit2.SetFocus;



GOSTEI 0
Michelli88

Michelli88

14/09/2005

O loco, qta gente heheheh.... :oops:


GOSTEI 0
Rjun

Rjun

14/09/2005

Se colocar no evento OnKeyPress não vai funcionar sempre. É melhor deixar no OnChange.


GOSTEI 0
Michelli88

Michelli88

14/09/2005

Rjun.... Valeu pela dica! :roll:


GOSTEI 0
Fernando_cunha

Fernando_cunha

14/09/2005

Funcionou...
obrigado pessoal...


GOSTEI 0
POSTAR