Fórum permitir somente digitar as letras S e N #365975
10/11/2008
0
Quero permitir que o usuário somente consiga digitar as letras S e N, estou fazendo dessa forma:
if (key <> #8) then // pra permitir o backspace
if not (key = ´S´) or (key = ´N´) then
Key := 0;
Mas não está funcionando...
Alguém pode me ajudar... sou iniciante e deve ser alguma coisa mínima q deva ser mudando, mas não sei onde.
Obrigada!
Daia
Curtir tópico
+ 0Posts
10/11/2008
Facc
if not key in [´S´, ´N´] then procedimentos
Gostei + 0
10/11/2008
Daia
Fiz da forma q você sugeriu, mas tb não deu certo, ele não permite q eu digite nenhuma letra nem S, nem N, nem E, mas permite q eu apague.
procedure TFCadMov.cbESKeyPress(Sender: TObject; var Key: Char);
begin
if (key <> #8) then // pra permitir o backspace
if not (key in [´S´,´N´]) then
Key := 0;
end;
Gostei + 0
10/11/2008
Facc
não tenho Delphi instalado aqui. mas tente assim
procedure TFCadMov.cbESKeyPress(Sender: TObject; var Key: Char); begin if (not (key in [´S´,´N´])) and (key <> 8) then Key := 0; end;
Gostei + 0
10/11/2008
Daia
if (key <> #8) then // pra permitir o backspace
if not (key in [´s´,´S´,´n´,´N´]) then
Key := 0;
Muito obrigada por me ajudar.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)