Fórum Formatar Data #331310
17/10/2006
0
Ex:
Se eu digitar 17 já acrescente a ´/´ automaticamente
Se eu digitar 10 acrescente a outra ´/´
Se eu digitar 2006 verificar se a data informada é válida e pular o foco para o próximo campo
então ficaria 17/10/2006 já com o foco em outro campo
Visualdesigner
Curtir tópico
+ 0Posts
17/10/2006
Steve_narancic
Gostei + 0
17/10/2006
Visualdesigner
Gostei + 0
17/10/2006
Output
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key = #8 then exit; if Length(edit1.text) = 2 then begin edit1.text:= edit1.text + ´/´; edit1.SelStart:= Length(edit1.text); end; if Length(edit1.text) = 5 then begin edit1.text:= edit1.text + ´/´; edit1.SelStart:= Length(edit1.text); end; end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)