how to add to a buttom a keyboard key "Enter Key" (really easy)

Posted on 2007-10-16
Last Modified: 2013-11-26
i have a buttom that perform a search but if i click on it it does its job now is there a way that i can add the Enter key from the keyboard to do the same job?

for instance if i do hit enter on the keyboard i will do the same thing if i do click on the buttom?
how can i do this?
Question by:jsctechy
    LVL 85

    Accepted Solution

    For the FORM, set the AcceptButton() Property to the button you want to be clicked when the user presses Enter:
    LVL 8

    Expert Comment

    Set the event: OnKeyPress (or similar) of the textbox of your search box, adn call the button function from there

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now