Porque no Funciona ????
Hola en esta ocacion estoy nesecitando lo siguiente
Private Sub MSFlexGrid1base_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then msgbox " Hola "
end sub
Y no funciona porque ?????
Private Sub MSFlexGrid1base_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then msgbox " Hola "
end sub
Y no funciona porque ?????
驴La tecla que deseas detectar responde al caracter '('?
Si la respuesta es SI prueba a poner un 56 en lugar de un 40.
Si lo que quieres detectar son los valores ANSI de las teclas pulsadas utiliza el evento KeyPress, esto viene indicado en la ayuda del evento KeyDown, dado el el evento KeyDown te devuelve el c贸digo de la tecla pulsada que no es el c贸digo ASCII de la tecla.
Saludos!!
l_island
Si la respuesta es SI prueba a poner un 56 en lugar de un 40.
Si lo que quieres detectar son los valores ANSI de las teclas pulsadas utiliza el evento KeyPress, esto viene indicado en la ayuda del evento KeyDown, dado el el evento KeyDown te devuelve el c贸digo de la tecla pulsada que no es el c贸digo ASCII de la tecla.
Saludos!!
l_island
gracias por responder !
Realmente la tecla que quiero que responda es la de la flecha para abajo.-
si yo coloco en un presedimiento MSFlexGrid1base_KeyDown
label1.caption = KeyCode
end sub
presiono la tecla que nesecito, en este caso la flecha para abajo y me salta el codigo "40"
teoricamente al reves tendria que funcionar , pero no !
ke esta pasando ???
Realmente la tecla que quiero que responda es la de la flecha para abajo.-
si yo coloco en un presedimiento MSFlexGrid1base_KeyDown
label1.caption = KeyCode
end sub
presiono la tecla que nesecito, en este caso la flecha para abajo y me salta el codigo "40"
teoricamente al reves tendria que funcionar , pero no !
ke esta pasando ???
Aqu铆 tienes una copia de lo que encontr茅 en la ayuda con respecto al FlexGrid y los eventos KeyUp y KeyDown; me temo que no puedes capturar esas teclas en estos eventos:
PRB: FlexGrid Control Doesn't Trap Arrow Keys
Last reviewed: July 23, 1997
Article ID: Q171733
The information in this article applies to:
Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0
SYMPTOMS
The KeyUp and KeyDown events of the Flexgrid control do not trap the Arrow keys. This affects the arrow keys on the numeric keypad as well as the "stand-alone" arrow keys.
CAUSE
The Flexgrid control responds to the arrow keys to change the selection, therefore they are not passed to the key events.
RESOLUTION
There are no workarounds at this time.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Turn the NumLock setting on your keyboard off.
Create a new Visual Basic project, Standard Exe.
Place a FlexGrid control on the new default form.
In the KeyUp event of the FlexGrid control, place the following code:
Msgbox KeyCode
Run the form, and click on the FlexGrid control.
Press any arrow key and note that the message box does not appear.
Press any other key and observe that the message box appears. (Hint: use the mouse to close the message box.)
Saludos!!
l_island
PRB: FlexGrid Control Doesn't Trap Arrow Keys
Last reviewed: July 23, 1997
Article ID: Q171733
The information in this article applies to:
Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0
SYMPTOMS
The KeyUp and KeyDown events of the Flexgrid control do not trap the Arrow keys. This affects the arrow keys on the numeric keypad as well as the "stand-alone" arrow keys.
CAUSE
The Flexgrid control responds to the arrow keys to change the selection, therefore they are not passed to the key events.
RESOLUTION
There are no workarounds at this time.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Turn the NumLock setting on your keyboard off.
Create a new Visual Basic project, Standard Exe.
Place a FlexGrid control on the new default form.
In the KeyUp event of the FlexGrid control, place the following code:
Msgbox KeyCode
Run the form, and click on the FlexGrid control.
Press any arrow key and note that the message box does not appear.
Press any other key and observe that the message box appears. (Hint: use the mouse to close the message box.)
Saludos!!
l_island
