473,386 Members | 1,694 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,386 software developers and data experts.

"\n" appearing as text in textboxes

What's with these newline characters and textboxes. I've noticed this
in .NET and it wasn't prevelant in Visual Studio 6.0.

Unless you have a richtext box, which displays the text representation
of the newline character as it reads on paper, the ordinary text box
displays the character representation instead.

Why? Is there a way to turn it off in an ordinary text box?

Aug 17 '06 #1
3 1301
Hi Sathyaish,

\n is not a valid character for new lines on windows systems, although
most controls accept \n as new line, you really should use \r\n or
System.Environment.Newline as some controls (like TextBox) does not accept
just \n
On Thu, 17 Aug 2006 09:02:00 +0200, Sathyaish <sa*******@gmail.comwrote:
What's with these newline characters and textboxes. I've noticed this
in .NET and it wasn't prevelant in Visual Studio 6.0.

Unless you have a richtext box, which displays the text representation
of the newline character as it reads on paper, the ordinary text box
displays the character representation instead.

Why? Is there a way to turn it off in an ordinary text box?


--
Happy Coding!
Morten Wennevik [C# MVP]
Aug 17 '06 #2
Kim
Havent seen nor needed this myself, but could it be that you dont have
set the property "Multiline" to true ?

If that doesnt work, you could use the String.Replace() method, by
replacing "\n" with "".

Sathyaish skrev:
What's with these newline characters and textboxes. I've noticed this
in .NET and it wasn't prevelant in Visual Studio 6.0.

Unless you have a richtext box, which displays the text representation
of the newline character as it reads on paper, the ordinary text box
displays the character representation instead.

Why? Is there a way to turn it off in an ordinary text box?
Aug 17 '06 #3
Thanks, Morten. Kim, Morten is right.

Aug 17 '06 #4

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

Similar topics

2
by: crjunk | last post by:
I'm trying to write a piece of code that will programatically save a record automatically without me having to add a new ' Row.Item("ADD1") = txtAdd1.Text.Trim.ToUpper ' type command each time I...
6
by: Andre Ranieri | last post by:
I'm trying to create a login page for customers to log into our corporate website, our presidents naturally wants the user and password fields to populate from a cookie so the customer doesn't have...
0
by: Mohammad Ali via DotNetMonster.com | last post by:
hi guys, I have a problem with my datagrid. My form is set up so I have two textboxes an add button and an editable datagrid. The datagrid is bound to a datatable which is in my cache.When I...
9
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to...
6
by: timbobd | last post by:
I have a Windows form that displays a database table in a DataGrid. When you click on a row, the row's values get copied to bound TextBoxes below, and when the "Save" button is clicked the database...
2
by: Pao | last post by:
I have to validate some textboxes. The rule is that only numbers and null values are good. But in case of null values, I have to substitute them with "0". How can I do? thanks
10
by: hacorbin | last post by:
I have a VB.NET program I am creating that sums 7 textboxes and displays their total in a total textbox. code: Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As...
16
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString...
10
by: Dave griffiths | last post by:
Hi all Using VB2005 on Vista with a Norwegian locale setup. The test program has 3 textboxes the sum held in txt3. Using the code below, txt2 conversion causes an error when it is left empty....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
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...

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.