• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

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

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
jjc9809
Asked:
jjc9809
  • 4
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
jjc9809Author Commented:
Idle_mind,

I right click on the button, but see no AcceptButton property listed.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Re-read....  =)

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

AcceptButton() is a Property of the Form, not the Button.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
jjc9809Author Commented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now