473,800 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4551
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**********@g mail.comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.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.netw rote:
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...@g mail.comwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.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**********@g mail.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.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.netw rote:
>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...@g mail.comwrote in message

news:11******* *************** @k79g2000hse.go oglegroups.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
16409
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
49733
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
1518
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
2713
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 carriagereturn,linefeed ('\n\r') , Since the Combo box can not display carriage return it displays it as symbol which looks very bad Can any body suggest any way to avoid it. (It will be fine even if i am able to display data only till first carriage...
1
2202
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. Apparently it's not the same with the web textbox. Thanks.
3
2275
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
3737
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 following: My address: 555 Maple Somewhere, USA
2
4256
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 PS2 keyboard jack, so to Windows, it's essentially just a keyboard. After the reader has finished reading the barcode, it sends out Ctrl + M (which I *think* is a carriage return). To capture the Ctrl + M, I configured an event handler for the
2
17026
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 that the user puts in (return/enter key) do not show up when the data is retrieved. It is one long line. Is there any way to make the user's paragraph divisions show up in the report?
11
12606
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 so the user can edit the default email message body before sending the message. But when I populate the large text box (txtBody), I can't get it to include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) and Chr(13). I've got the...
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.