Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8608567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:38:45+00:00 2026-06-12T03:38:45+00:00

Is there a better way to have a keydown handler for many controls on

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:38:47+00:00Added an answer on June 12, 2026 at 3:38 am

    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.

    1. Write up a method which AddHandlers for your respective controls, if and only if, they have specific value set to a property (details in step #2 below)
    2. All controls, to which you want a common handler to be attached, set their Tag property to a unique value, for example : "KeyDown". I would recommend use of Enum though in this case, instead of string
    3. Now, in your Form constructor, after InitializeComponent call, call the method you wrote in #1 above. This will attach handlers to all desired controls.
    4. If you have multiple forms having this requirement, you can add this functionality to a main form, which acts like a parent for all others (inheritance)

    Hope I am clear enough and this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a better way to do this jquery code? Currently I have to
If I have this line and I'm wondering if there's better way to do
I have a workable solution but I'm pretty convinced there's a better way of
I am wondering if there is a better way to make some mysql tables
Is there a better way to have the same output generated by the following
Is there any way to have a reverse proxy using http basic Authentication in
Is there a better way to have a globally accessible Zend_Log object? In Bootstrap.php
Is there better way to delete a parameter from a query string in a
Is there better way to enumerate all photos on the device than this one?
Is there a better way to code this? def __contains__(self, e): return e in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.