473,407 Members | 2,629 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,407 software developers and data experts.

textbox newline

How do create a new line in a text box.

If I put \n in my string, and set .Text to the
value of the string, a carriage return character is displayed literally,
but it doesn't actually start on a new line in the textbox.

Nov 15 '05 #1
6 12357
"john bailo" <jb****@vestcom.com> wrote in message
news:14******************************@news.teranew s.com...
How do create a new line in a text box.
If I put \n in my string, and set .Text to the
value of the string, a carriage return character is displayed literally,
but it doesn't actually start on a new line in the textbox.


Use \r\n.

-- Alan
Nov 15 '05 #2
If you do it programatically "Something\r\nWicked" it will show up as a
newline but not if you go through the designer. Also, ensure that you don't
have the @ (literal string) in front of it.

--
Bob Powell [MVP]
C#, System.Drawing

September's edition of Well Formed is now available.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

"john bailo" <jb****@vestcom.com> wrote in message
news:14******************************@news.teranew s.com...
How do create a new line in a text box.

If I put \n in my string, and set .Text to the
value of the string, a carriage return character is displayed literally,
but it doesn't actually start on a new line in the textbox.

Nov 15 '05 #3
Where can you look up all those \r\n thingy me gigs in the in the
documentation?

Nov 15 '05 #4
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
If you do it programatically "Something\r\nWicked" it will show up as a
newline but not if you go through the designer. Also, ensure that you don't have the @ (literal string) in front of it.

Bob Powell [MVP]
C#, System.Drawing


Thanks -- I left off the \r and just put in the \n

Now it works !!!

Thanks Bob.
Nov 15 '05 #5
>all those \r\n thingy me gigs

Not many of them...

\\ literal backslash
\n literal newline
\r literal carriage return
\t literal horizontal tab
\v literal vertical tab
\" literal double-quote

\v is recognized but you can't use it in a text box.

--
Bob Powell [MVP]
C#, System.Drawing

September's edition of Well Formed is now available.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

"Empire City" <a@b.com> wrote in message
news:45*******************@twister.nyc.rr.com...
Where can you look up all those \r\n thingy me gigs in the in the
documentation?

Nov 15 '05 #6
Theres more.. here's the definitive list.

\' Single quote
\" Double quote
\\ Backslash
\0 Null
\a Alert / Bell
\b Backspace
\f Form feed
\n New line
\r Carriage return
\t Horizontal tab
\v Vertical tab
--
Bob Powell [MVP]
C#, System.Drawing

September's edition of Well Formed is now available.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

"Empire City" <a@b.com> wrote in message
news:45*******************@twister.nyc.rr.com...
Where can you look up all those \r\n thingy me gigs in the in the
documentation?

Nov 15 '05 #7

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

Similar topics

16
by: Ramsin Savra | last post by:
Hi, What do you suggest to do if I want to do a search in TextBox ? I know that using RichTextBox, we could have Find method to search for a specific word or information but I was wonder if...
5
by: Kaka | last post by:
Hi, I am a learner for C# and .Net. I want to know how to put a line break to a string so that when it show in the textbox the text will be displayed in saperated lines. e.g.: String s; s...
22
by: Tim | last post by:
Hi A while ago I got some help in writing a mock console. The idea was to write a VB app that contained a textbox, then run a process from within the app and redirect the stdout to the textbox. ...
6
by: poojo hackma | last post by:
How is the New Line character written to the TextBox field (TextBox.Multiline=True)? For example: TextBox1.Text = "Line 1\nLine 2"; Above does not produce 2 lines in the TextBox1. Simple...
2
by: nhaydon | last post by:
There has to be way to do this. Any help would be appreciated. Here is the code. txtReturn.Text = data + Environment.NewLine + data + Environment.NewLine + data + Environment.NewLine + data +...
4
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, I've got a webservice that just returns a string, and in the middle of the string, I use a controlchars.newline. When I set this string to the text property of a textbox, it shows up as one...
7
by: Anil Gupte | last post by:
I have read a lot about getting lines from a multiline textbox in VB.Net. However, I cannot for the life of me figure out how to write to a multiline textbox. Basically, I have created an array of...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In multiLine textBox, enter moves to the next line, how can i overwrite it, so enter will move to the next control and ctrl + enter will move to the next line? Thanks, Gidi.
3
by: zacks | last post by:
I have a multiline textbox control where I would like to load up with something like the following: This is Line 1 <- this line is NOT bold This is Line 2 <- this line is...
0
by: Steve K | last post by:
to this newline when an enter key is detected. Update: I tried adding this code: <code> public PMDDataGridViewTextBoxEditingControl() :base() { this.Multiline = true; } </code>
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
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...
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
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...
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,...
0
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...

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.