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
180 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
Industry Leaders: 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 500 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

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!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 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