Fórum evento ONKEYPRESS #177064
23/08/2003
0
Olá à todos do forum.!
Estou precisando de um código que faça o seguinte:
Qdo eu apertar, por exemplo, a tecla 1 do meu teclado o PANEL1 fique com a propriedade ENABLE = TRUE, apertando novamente a tecla 1 a propriedade ENABLE = FALSE.
Tentei no evento ONKEYPRESS do FORM o seguinte:
IF (KEY = #49) THEN BEGIN
PANEL1.Enabled := TRUE;
PANEL1.Color := CLRED;
END
ELSE
PANEL1.ENABLED := FALSE;
PANEL1.Color := CLLIME;
Obrigado a todos!
Estou precisando de um código que faça o seguinte:
Qdo eu apertar, por exemplo, a tecla 1 do meu teclado o PANEL1 fique com a propriedade ENABLE = TRUE, apertando novamente a tecla 1 a propriedade ENABLE = FALSE.
Tentei no evento ONKEYPRESS do FORM o seguinte:
IF (KEY = #49) THEN BEGIN
PANEL1.Enabled := TRUE;
PANEL1.Color := CLRED;
END
ELSE
PANEL1.ENABLED := FALSE;
PANEL1.Color := CLLIME;
Obrigado a todos!
Rkaliman
Curtir tópico
+ 0
Responder
Posts
23/08/2003
Afarias
Coloque a propriedade KeyPreview do Form para TRUE e no evento KeyPress o código::
IF (KEY = #49) THEN
BEGIN
PANEL1.Enabled := not PANEL1.Enabled;
if PANEL1.Enabled then
PANEL1.Color := CLRED
else
PANEL1.Color := CLLIME;
END;
T+
IF (KEY = #49) THEN
BEGIN
PANEL1.Enabled := not PANEL1.Enabled;
if PANEL1.Enabled then
PANEL1.Color := CLRED
else
PANEL1.Color := CLLIME;
END;
T+
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)