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

TextBox Breaks and new lines

I have a textbox and want to insert data into it from a datagrid like so
TextBox2.Text = "Milestone ID: " + mileid;
TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
TextBox2.Text = TextBox2.Text + "Milestone Description: " + description;
TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
Is there any way to add a newline so that each bit of text appears on a
seperate line of the textbox
Thanks
Nov 18 '05 #1
7 1154
You can't. A textbox is a one line only.
Use a textarea for it to work.

"Jonathan Dixon" <jo**@ukonline.co.uk> schreef in bericht
news:ON**************@TK2MSFTNGP12.phx.gbl...
I have a textbox and want to insert data into it from a datagrid like so
TextBox2.Text = "Milestone ID: " + mileid;
TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
TextBox2.Text = TextBox2.Text + "Milestone Description: " + description;
TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
Is there any way to add a newline so that each bit of text appears on a
seperate line of the textbox
Thanks

Nov 18 '05 #2
How would i do it with a text area

Thanks
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
You can't. A textbox is a one line only.
Use a textarea for it to work.

"Jonathan Dixon" <jo**@ukonline.co.uk> schreef in bericht
news:ON**************@TK2MSFTNGP12.phx.gbl...
I have a textbox and want to insert data into it from a datagrid like so
TextBox2.Text = "Milestone ID: " + mileid;
TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
TextBox2.Text = TextBox2.Text + "Milestone Description: " + description;
TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
Is there any way to add a newline so that each bit of text appears on a
seperate line of the textbox
Thanks


Nov 18 '05 #3
I have added an html text area to the aspx page but how do i assign text to
it from the C# codebehind
"Jonathan Dixon" <jo**@ukonline.co.uk> wrote in message
news:eV**************@tk2msftngp13.phx.gbl...
How would i do it with a text area

Thanks
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
You can't. A textbox is a one line only.
Use a textarea for it to work.

"Jonathan Dixon" <jo**@ukonline.co.uk> schreef in bericht
news:ON**************@TK2MSFTNGP12.phx.gbl...
I have a textbox and want to insert data into it from a datagrid like so

TextBox2.Text = "Milestone ID: " + mileid;
TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
TextBox2.Text = TextBox2.Text + "Milestone Description: " + description; TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
Is there any way to add a newline so that each bit of text appears on a seperate line of the textbox
Thanks



Nov 18 '05 #4
Dont worry about it i figured it out, changing it to a server control,

Thanks for your help
"Jonathan Dixon" <jo**@ukonline.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have added an html text area to the aspx page but how do i assign text to it from the C# codebehind
"Jonathan Dixon" <jo**@ukonline.co.uk> wrote in message
news:eV**************@tk2msftngp13.phx.gbl...
How would i do it with a text area

Thanks
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
You can't. A textbox is a one line only.
Use a textarea for it to work.

"Jonathan Dixon" <jo**@ukonline.co.uk> schreef in bericht
news:ON**************@TK2MSFTNGP12.phx.gbl...
> I have a textbox and want to insert data into it from a datagrid
like
so >
>
> TextBox2.Text = "Milestone ID: " + mileid;
> TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
> TextBox2.Text = TextBox2.Text + "Milestone Description: " + description; > TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
> TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
>
>
> Is there any way to add a newline so that each bit of text appears
on
a > seperate line of the textbox
>
>
> Thanks
>
>



Nov 18 '05 #5
How could i add the breaks or new lines in.

Please reply it is very urgent
Thanks
Nov 18 '05 #6
TextBox has property TextMode that can be set to MultiLine. Having set this,
you can insert newline character in the places you want.

Eliyahu

"Jonathan Dixon" <jo**@ukonline.co.uk> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...
I have a textbox and want to insert data into it from a datagrid like so
TextBox2.Text = "Milestone ID: " + mileid;
TextBox2.Text = TextBox2.Text + "Milestone Name: " + milestonename;
TextBox2.Text = TextBox2.Text + "Milestone Description: " + description;
TextBox2.Text = TextBox2.Text + "Milestone Folder: " + directory;
TextBox2.Text = TextBox2.Text + "Date Added: " + dateadded;
Is there any way to add a newline so that each bit of text appears on a
seperate line of the textbox
Thanks

Nov 18 '05 #7
VB:
import microsoft.visualbasic

where you want an "enter" put a "vbCrLf" like:

"firstline" & vbCrLf &_
"new line."
Hope this helps you
"Jonathan Dixon" <jo**@ukonline.co.uk> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl...
How could i add the breaks or new lines in.

Please reply it is very urgent
Thanks

Nov 18 '05 #8

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

Similar topics

1
by: Bill | last post by:
I am downloading data from a website that displays it in a table $fp = fopen("a website page", 'r'); The following accesses the stream one <td> element at a time $myData = fgets($fp); Then I...
6
by: Jonathan | last post by:
I want to save textarea contents to a mysql database with the paragraph breaks intact without having to type paragraph or break tags in HTML. How can I do that. So far, although it occurs naturally...
5
by: Paddy | last post by:
I am reading a file like so: using(FileStream inStream = new FileStream ("addresses",FileMode.Open,FileAccess.Read)) { } One of the strings is long and is displayed in a multil;ine textbox.
2
by: Mike | last post by:
I need my textbox to work more smoothly with respect to line breaks. When I have data pulled from the database into a textbox there are hard line breaks at the end of each line (by definition how...
3
by: HDB | last post by:
Ok. I have a windows form with a textbox for displaying certain messages. Multiline=true and wordwrap=true. I want to know the amount of the lines currently showing. That should not be any...
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
1
by: Developer | last post by:
VC++ 2005 Express Edition: I have a textBox with the properties: this->m_TextBox_Desc->Multiline = true; this->m_TextBox_Desc->WordWrap = true; this->m_TextBox_Desc->ScrollBars =...
2
by: Nathan Sokalski | last post by:
I have a multiline TextBox that I want to display the text used to create a control in an apsx file. I want each of these to be on a separate line in the TextBox. The only way I know of to place...
1
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.