Hello,
"MS Newsgroups" <(E-Mail Removed)> schrieb:
> I would like to capture when a user presses F5 in my Windows
> form application, but the keypress event does not seem to fire
> when a function key is pressed, Is there another way of doing this ?
Set the form's 'KeyPreview' property to 'True' and add this code:
\\\
Private Sub Form1_KeyDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs _
) Handles MyBase.KeyDown
If e.KeyCode = Keys.F5 Then
MsgBox("F5 pressed!")
End If
End Sub
///
HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet