Fórum KeyPress --gt; Key = #13 não funciona no Edit, porque? #300060
20/10/2005
0
if Key = 13 then
begin
TbConsConta.Close;
TbConsConta.ParamByName(´pIDconta´).AsString := EdConta.Text;
TbConsConta.Open;
end;
Coloco um Brealpoint e nada, ele mostra todas as teclas, menos o ENTER, ESC e etc... já habilitei o KeyPrevioew no Form e tudo....
o que pode ser?
[]s
Titanius
Curtir tópico
+ 0Posts
20/10/2005
Bruno Belchior
Gostei + 0
20/10/2005
Marcio.theis
Gostei + 0
20/10/2005
Titanius
Gostei + 0
20/10/2005
Martins
Olha só Titanius, sei q isso aqui é trocar 6 por meia dúzia mas, tenta assim cara:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key = char(13) then begin key := 0; ShowMessage(´Pressionou o ENTER!!!´); //Só p/ saber se o evento é disparado. TbConsConta.Close; TbConsConta.ParamByName(´pIDconta´).AsString := EdConta.Text; TbConsConta.Open; end;
Talvez ajude!!!
Gostei + 0
20/10/2005
Weber
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = vk_Return then begin TbConsConta.Close; TbConsConta.ParamByName(´pIDconta´).AsString := EdConta.Text; TbConsConta.Open; end; end;
Lembre-se de deixar a propriedade KeyPreview como True.
Gostei + 0
20/10/2005
Fx|hand
Procedure TForm1................... Begin If Ord(Key) = VK_RETURN then ShowMessage(´Enter Pressionado!´) end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)