?
Solved

I have a search button setup in VB, but need to have user be able to select Enter after typing in the criteria to search by

Posted on 2012-03-19
6
Medium Priority
?
181 Views
Last Modified: 2012-03-19
Hello everyone,

I have setup a Search textbox in VB and I have a search button which does a search in finding records, but what if the user is lazy and does not want to select the Search button everytime and just selects the enter key.  Is there any coding that needs to be setup for the user to just select the Enter Key instead?  They want to do this also if the they so desire?

jjc9809
0
Comment
Question by:jjc9809
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 37738374
No code is needed.

Select the Form, then set the AcceptButton() property to your Button:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.acceptbutton.aspx

    "Gets or sets the button on the form that is clicked when the user presses the ENTER key."
0
 

Author Comment

by:jjc9809
ID: 37738543
Idle_mind,

I right click on the button, but see no AcceptButton property listed.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 37738557
Re-read....  =)

"Select the FORM, then set the AcceptButton() property to your Button"

AcceptButton() is a Property of the Form, not the Button.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jjc9809
ID: 37738616
Idle Mind,

The form that I have is an Aspx web form not a windows form.

Do you have the setting of the property the same with a web form?
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 37738639
Ah...that makes a huge difference.  Be sure to state in your future questions if you're working in WinForms or WebForms.  =\

I'm not a web programmer so I'm not sure how to do that.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 37738962
You could have deleted this question or requested attention to get more people in on it.  I didn't really answer your question...
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

752 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