Bom dia galera!!!
Uso o seguinte, para tratar o pressionamento das teclas page down, page up, enter, etc.
'--------------------------------------------------------------------
Private Sub txtEcaFolha_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 34 Then 'Page Down
cmdProximo_Click
ElseIf KeyCode = 33 Then 'Page Up
cmdAnterior_Click
ElseIf KeyCode = 115 Then 'Tecla F4
If fraEventos(0).Visible = True Then
Call cmdMais_Click(0)
Else
Call cmdMais_Click(1)
End If
End If
End Sub
Private Sub txtEcaFolha_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then 'Enter
KeyAscii = 9
SendKeys "{Tab}"
End If
End Sub
'--------------------------------------------------------------------
A minha pergunta é: como faço para tratar o pressionamento dessas teclas em qualquer lugar do form, independentemente de onde está o foco?
Será que fui claro? Por exemplo, não importa em que lugar do formulário eu estiver, quando presssionar F5 faça isso ou aquilo.
Agradeço antecipadamente.
Gelson