Fórum Problema com verificação na digitação #349563
24/11/2007
0
custo_real:=Edit1.Text;
if (custo_real<>´´) then
Begin
for t:=0 to Length(custo_real) do
begin
if (not(((custo_real[t]>=´0´) and (custo_real[t]<=´9´)) or (UpperCase(custo_real[t])=´X´) or (UpperCase(custo_real[t])=´U´) or (UpperCase(custo_real[t])=´G´) or (UpperCase(custo_real[t])=´B´) or (UpperCase(custo_real[t])=´W´) or (UpperCase(custo_real[t])=´R´))) then
begin
ShowMessage(´Por favor utilize valores numericos ou que se encontrem dentro da Legenda de Custo´);
Edit1.SetFocus;
Break;
end;
end;
Bem essa função fica no OnExit do Edit.
Agluem tem alguma ideia do que pode ser ?.
Robo
Curtir tópico
+ 0Posts
24/11/2007
Luciano.lirio
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin Key := UpCase(Key); if not (UpCase(Key) in [´0´..´9´,´X´,´W´,´G´,´R´,´U´,´B´]) then Key := 0; end;
Gostei + 0
24/11/2007
Robo
Gostei + 0
24/11/2007
Luciano.lirio
Gostei + 0
24/11/2007
Robo
tipo ele realmente ta querendo mesmo.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)