Results 1 to 5 of 5

Thread: Using Functions keys F1 to F12

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    42

    Arrow Using Functions keys F1 to F12

    Can anyone tell me how I can 'see', in a VB form, whether the function-keys are pressed.
    And how to launch a procedure at that moment?

    Maybe some code please?

    Thnx

  2. #2
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Try this

    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    If e.KeyCode = Keys.F2 Then MsgBox("F2 Pressed")
    End Sub
    That which does not kill us, only makes us stronger.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    42
    Thanx wolfofthenorth

    but in your example I should place the code after every control of my form.
    I would like to fire the event/procedure as soon the button is pressed. Can't I put the code after the KeyPressed-event from the form?

    I hope you have the solution

    Thnx

    B.

  4. #4
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    I don't think some of the function keys will fire the KeyPress event. It looked like F keys will only fire the Key up and down events.

    You might be able to have one event handle all of your controls. ?
    That which does not kill us, only makes us stronger.

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    42
    I'll explore that approach, thnx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width