Fórum Utlizando as teclas tab e enter #233118
19/05/2004
0
gostaria de saber como faço para que o enter abra o meu form e fazer a tecla tab se tranformar num enter (isso pra outro form). Eu sei que isso fica no evento onkeypress do button mas naum sei como fazer. Alguém poderia me ajudar? Muito obrigado.
Elias Jr
Curtir tópico
+ 0Posts
19/05/2004
Ehvasc
Gostei + 0
19/05/2004
Felippe
//Codigo
procedure TForm.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
If Key = #13 Then
Begin
If HiWord(GetKeyState(VK_RETURN)) <> 0 then
begin
//codigo aki dentro casa a tecla enter seja precionada
end;
end;
end;
Gostei + 0
19/05/2004
Fabiano Freitas
no [b:ba277afc10]OnKeyPress[/b:ba277afc10] do Form põe o seguinte:
if (key = #13) and
not (ActiveControl is TMemo){o Enter deve funcionar em um tmemo} then
begin
Key := 0; //anula o efeito da tecla
Perform(WM_NEXTDLGCTL,0,0); //foca o próximo componente possível
end;
[]´s
Fabiano Freitas
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)