Click to See Complete Forum and Search --> : Function Keys


Shiv Kumar G.M.
October 22nd, 2001, 11:04 PM
Hello gurus,
I have a MDI form, which contains lot of child forms. For example, in one form, I would like to make use of function keys, F2-Save, F3-Open that way. In different forms, different keys are used. I do not anything abt this.

Any help is greately appreciated.

Regards,
Shivakumar G.M.

Cakkie
October 23rd, 2001, 02:01 AM
You can use the KeyDown event of the child forms. Then you can use the KeyCOde to check what key was pressed.

private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)

Select Case KeyCode
Case vbKeyF2
MsgBox "You pressed F2"
Case vbKeyF3
MsgBox "You pressed F3"
Case vbKeyF4
MsgBox "You pressed F4"
End Select

End Sub




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook