Is there a better way to have a keydown handler for many controls on a busy form? (Using the form handler alone doesn’t work in some cases.)
Private Sub rText_KeyDown(ByVal Sender As Object, ByVal e As KeyEventArgs) Handles rText0.KeyDown, txTaxon.KeyDown, txCommon.KeyDown, _
txConfidence.KeyDown, txDate.KeyDown, txDateAdded.KeyDown, txFileName.KeyDown, txGPS.KeyDown, txRating.KeyDown, _
txConfidence.KeyDown, txQuality.KeyDown, txRemarks.KeyDown, txKeyWords.KeyDown, txOriginalPath.KeyDown, txDateAdded.KeyDown, _
txLink.KeyDown, chkLink.KeyDown, rview.KeyDown, cmdNext.KeyDown, tvTaxon.KeyDown, Me.KeyDown, _
cmdTaxon.KeyDown
Call globalkey(e)
End Sub
I am a C# programmer, and hence wont be able to provide a working solutions (as in vb.net code).
I think that you can get this working by doing following things.
"KeyDown". I would recommend use ofEnumthough in this case, instead ofstringFormconstructor, afterInitializeComponentcall, call the method you wrote in #1 above. This will attach handlers to all desired controls.Hope I am clear enough and this helps.