Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to use Funtion Keys in my project

hemantsangoihemantsangoi Member Posts: 19
I want my application to end on pressing F1 key,
user to logout on pressing F2 etc
How do I do it ?

Comments

  • s_sreenaths_sreenath Member Posts: 20
    I am not sure of doing this. But one simple idea is u can use the ASCII key values of the functional keys and then you can manipulate the action which u want to do. Cheers...



  • vibin_mdcpvibin_mdcp Member Posts: 60
    : I am not sure of doing this. But one simple idea is u can use the
    : ASCII key values of the functional keys and then you can manipulate
    : the action which u want to do. Cheers...
    :

    Hai, Here you have to add a KeyUp Event for your Form. Now compare the KeyCode with a constant in vbKeyCodeConstants.

    Example

    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyF1 Then
    MsgBox "F1 pressed"
    End If
    End Sub

    Example End

    Use object browser for more vbKeyCodeConstants.
  • hemantsangoihemantsangoi Member Posts: 19
    Thanks it worked.
Sign In or Register to comment.