Use of function keys (F1...F12...ESC key etc) in a form

What do I need to set up so that I can determine if a function key has been pressed whilst the user is on a Form?


  • Verified Answer

    Trap the KeyDown event on the form.

          method-id Form1_KeyDown final private.
          procedure division using by value sender as object e as type System.Windows.Forms.KeyEventArgs.
    |          if e::KeyCode = type Keys::F1
                 invoke type MessageBox::Show("F1 was pressed")
                 set e::Handled to true
          end method.