473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

focus to button control on enter

I have a webform that has multiple text boxes and 3 buttons ( Clear,
Close, Search). After test is entered in one of the textboxes I want
the Search button selected if the user presses enter. Currently the
clear button is engaged upon enter.

I have entered the following code in the textchanged event.

Protected Sub txtERname_TextChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles txtERname.TextChanged

btnSearch.Focus()

End Sub

using VS 2005

thank you,

jason

Apr 11 '07 #1
4 1582
See

Page.SetFocus(Control)
Page.Form.DefaultButton

method/properties.
--
Milosz
"ca******@shaw.ca" wrote:
I have a webform that has multiple text boxes and 3 buttons ( Clear,
Close, Search). After test is entered in one of the textboxes I want
the Search button selected if the user presses enter. Currently the
clear button is engaged upon enter.

I have entered the following code in the textchanged event.

Protected Sub txtERname_TextChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles txtERname.TextChanged

btnSearch.Focus()

End Sub

using VS 2005

thank you,

jason

Apr 11 '07 #2
test
Apr 11 '07 #3
Milosz Skalecki wrote:
test
Sorry for testing :)
Apr 11 '07 #4
On Apr 11, 10:28 am, Milosz Skalecki [MCAD]
<mily...@DONTLIKESPAMwp.plwrote:
See

Page.SetFocus(Control)
Page.Form.DefaultButton

method/properties.
--
Milosz

"camel...@shaw.ca" wrote:
I have a webform that has multiple text boxes and 3 buttons ( Clear,
Close, Search). After test is entered in one of the textboxes I want
the Search button selected if the user presses enter. Currently the
clear button is engaged upon enter.
I have entered the following code in the textchanged event.
Protected Sub txtERname_TextChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles txtERname.TextChanged
btnSearch.Focus()
End Sub
using VS 2005
thank you,
jason- Hide quoted text -

- Show quoted text -
Thank you this is what I was looking for.

Apr 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
0
by: Miquel | last post by:
Hi all. I felt frustrated when developing an 'UserControl' derivated from textBox, because sequence event (and Validate event) seems to fail. I Always thought my code was wrong. But after...
1
by: VMI | last post by:
In my Windows app, if I'm in a multi-line textbox and I'm writing a postal address (ie. write ist line and press <Enter>, write 2nd line and press <Enter>, etc...) how can I make sure that the...
3
by: Philip Townsend | last post by:
I have an aspx page that contains 2 user controls, each containing a seperate textbox and button. I would like to specify that one of the buttons recieve focus when the page loads. Also, I would...
2
by: Rocio | last post by:
I have a aspx page, with 2 controls (ascx). Control1 contains a SEARCH button, and textbox to enter the string to search for. Control 2 contains a LOGIN button, and 2 text boxes to enter the...
0
by: David | last post by:
Here is the layout of my form from left to right, from top to down. - buttonA, buttonB, buttonC - textbox, textbox, textbox - buttonXXX After the user types in the textboxes and press enter...
2
by: Christian Ista | last post by:
Hello, I found that (see below) to give the focus to a control(textbox) on an asp.net page. There is no easiest way to do that ? Thanks, System.Text.StringBuilder sb = new...
1
by: amjad | last post by:
Hi i need to write javascript to shift control focus ..... like if i enter in textbox 1 then it set focus to textbox2 or 3 any thing ... the other thing is how i know i can do like...
4
by: Jon Slaughter | last post by:
Is there any method to temporarily disable focus changing?(I assume only method is tab or mouse?) This problem has been tieing me up for a while and nothing seems to work. The only thing that I...
2
by: Joergen Bech | last post by:
Hope someone has a solution or some suggestions for this. This cannot be right?!? Problem: I have multiple non-modal forms open at the same time. One or more of these forms have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.