473,396 Members | 1,797 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.

carriage return in a textbox -> click a button?

I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?

Sep 28 '07 #1
3 4514
In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"HockeyFan" <le**********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?
Sep 28 '07 #2
Does this mean that the default button gets clicked when a carriage
return is pressed inside a textbox?
On Sep 28, 10:09 am, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"HockeyFan" <les.stock...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?- Hide quoted text -

- Show quoted text -

Sep 28 '07 #3
Yes.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"HockeyFan" <le**********@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
Does this mean that the default button gets clicked when a carriage
return is pressed inside a textbox?
On Sep 28, 10:09 am, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
>In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the
default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"HockeyFan" <les.stock...@gmail.comwrote in message

news:11**********************@k79g2000hse.googleg roups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?- Hide quoted
text -

- Show quoted text -

Sep 28 '07 #4

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

Similar topics

4
by: Rob Lemieux | last post by:
Using Visual Basic 6.0 I want the program to be able to print the carriage return. txtDisplay.Text = "Welcome to" + Chr(13) + "my demo." All I get is Welcome to|my demo.
5
by: aw | last post by:
Hi MVP's, I have a VB expression that inserts text in a report's textbox: (code in report's On-Active) If not isnull(forms!myform!subject1) then TextBox = "John Doe" End If
2
by: Rulle | last post by:
Hi! How do I insert a newline in a textbox? I've tried this without success.. textBox1.Text = textBox1.Text + "\n"; Thanks!
2
by: Abhi | last post by:
I have a simple Combo box on my Form, Data in it is Coming from database, Data is stored in database Through a form where i am using Textbox to enter data The Source data to combobox contains...
1
by: VMI | last post by:
If I want to separate a string in a web textbox so that it takes several lines, how can do it? In a Windows textbox, I only needed to add the "\r\n" to the string for the carriage return....
3
by: Simon Middlemiss | last post by:
I have a multiline textbox which I would like populated in the following manner. "Line1 Line2 Line3 Line4" etc. I know how to do it in code, but is there a way to do it in the design view?
7
by: Nathan | last post by:
How do you code a carriage return in a textbox? For example, Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" & ?CarriageReturn? & "Somewhere, USA" so that the textbox shows the...
2
by: senfo | last post by:
Hello all, To help alleviate human error, I'm developing an application that uses a barcode reader to fill in a value in a TextBox control. The barcode reader is connected to the PC through the...
2
by: dancer | last post by:
Using ASP.Net and VB.net I have textboxes (<asp:textbox id......>) in which the user will be entering paragraphs. They are multiline (several rows and several columns). The carriage returns...
11
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.