473,387 Members | 1,678 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.

Line Breaks in Label

Can i put a line break in a label ??

Ie. I want to have

Name:
Address:
Address2:
.....

Listed like that instead of having it wrap, can I have a multiline label ?

Thanks.
Nov 17 '05 #1
2 11127
Use a carriage-return and line-feed ("\r\n") or vbcrlf in the text property
such as:
this.Label1.Text="Address1:\r\nAddress2";

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

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Fraser" <n/a> wrote in message
news:eo**************@TK2MSFTNGP12.phx.gbl...
Can i put a line break in a label ??

Ie. I want to have

Name:
Address:
Address2:
....

Listed like that instead of having it wrap, can I have a multiline label ?

Thanks.

Nov 17 '05 #2
Thanks Bob. Much appreciated.
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Os**************@TK2MSFTNGP14.phx.gbl...
Use a carriage-return and line-feed ("\r\n") or vbcrlf in the text
property such as:
this.Label1.Text="Address1:\r\nAddress2";

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

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Fraser" <n/a> wrote in message
news:eo**************@TK2MSFTNGP12.phx.gbl...
Can i put a line break in a label ??

Ie. I want to have

Name:
Address:
Address2:
....

Listed like that instead of having it wrap, can I have a multiline label
?

Thanks.


Nov 17 '05 #3

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

Similar topics

10
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width....
2
by: Jacek Stepniewski | last post by:
Hi, I would like to use <BR> in label control to break the line, but the control converts "<" and ">" to entity. How can i break the line?? Jack
1
by: buran | last post by:
Dear ASP.NET Programmers, I am carrying the input of a textbox via querystring. When I put the value of querstring in a label control, the line breaks are removed. The whole text is displayed as...
2
by: Nathan Sokalski | last post by:
I have a form that is laid out like the following: ------------ | | LABEL CONTROL | IMAGE | | | _________ I want the Label control to be on multiple lines...
8
by: Nalaka | last post by:
Hi I am showing a text paragraph in a labe control. But, the label control is ignoring my "newLines".... (newline+carraige return) ( I correct this paragraph using a multiline textBox) how...
1
by: nigel | last post by:
somebody recently showed me how to create a new line using \n which was great.The thing is when i am creating the programme the text i wish to add is quite long.and it ends up stretching the width...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
2
by: MDB | last post by:
Hello All, I have a label in a form view that I need to have display the line breaks. Is there an easy way to do this? For some reason, I havn't been able to find a straigh answer on this. ...
2
by: lochuanjiang | last post by:
Hi all, I have written a program and the label.text is retrieve from the database. However the length of the string could be very long and i would wish to have line breaks in certain portion ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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.