hot key

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

ok.. i am using the form keydown event..
with a select case e.keycode and trying to find when the user puts in ctrl
+ f
how do i combine an expression to represent this so the keycode will be
matched in my select statemen?
 
ok.. i am using the form keydown event..
with a select case e.keycode and trying to find when the user puts in ctrl
+ f
how do i combine an expression to represent this so the keycode will be
matched in my select statemen?

You can use KeyData instead of KeyCode to combine two keys as follows
within Select-Case block:

'-------Begin----------
Private Sub Form1_KeyDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles MyBase.KeyDown
Select Case e.KeyData
Case Keys.Control + Keys.F
' Implement stuff
End Select
End Sub
'--------End--------

Hope this works,

Onur Güzel
 
Brian said:
ok.. i am using the form keydown event..
with a select case e.keycode and trying to find when the user puts in
ctrl + f
how do i combine an expression to represent this so the keycode will be
matched in my select statemen?

\\\
Private Sub Form1_KeyDown( _
ByVal sender As Object, _
ByVal e As KeyEventArgs _
) Handles Me.KeyDown
If _
e.KeyCode = Keys.F AndAlso _
CBool(Control.ModifierKeys And Keys.Control) _
Then
MsgBox("Hello")
End If
End Sub
///
 
Back
Top