Fórum verificar se o que esta no Tedit é menor que 100 #193009
05/11/2003
0
ou se tiver como só deixar ele digitar somente esses valores...
Zumbi
Curtir tópico
+ 0Posts
05/11/2003
Sam
Para testar os valores digitados utilize o evento ONEXIT do TEDIT
if StrToFloat(Edit1.text) > 100 then
begin
ShowMessage(´Valor Incorreto´);
Edit1.SetFocus;
end;
Gostei + 0
05/11/2003
Caninha51
for i := 0 to ComponentCount - 1 do
if Components[i] is TEdit then
if StrToInt((Components[i] as TEdit).Text) > 100 then
begin
showmessage(´> 100´);
(Components[i] as TEdit).SetFocus;
Break
end;
Falow
Caninha51
Gostei + 0
05/11/2003
Marcelo Saviski
Adicione esse código:
whith (Sender as TEdit) do begin if (StrToIntDef(Text + Key, 101) > 100) or (not (Key in [´0´..´9´, chr(VK_BACK)])) then Key := 0; end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)