Forum guidelines
c# Label Multiline
Posted By iron_ste on 22 Apr 2005
Is it possible to create a label with multline property?
Re: c# Label Multiline
Posted By ytram5 on 22 Apr 2005  
I would consider them already multi-line, as the text will wrap to the next line if it exceeds the horizontal size of the label.
Re: c# Label Multiline
Posted By mibuyt on 24 Apr 2005  
Yeah that is possible. Instead of using the label property... view the code behind and do this instead: this.label1.Text = @" Line 1 Line 2 Line 3 "; Remember to place the @ in front of the "". It enables you to do as above. Hope it helps. Cheers.
Re: c# Label Multiline
Posted By iron_ste on 26 Apr 2005  
Thanks for your help guys!
Re: c# Label Multiline
Posted By Md Islam on 03 Feb 2010  
In the Label Properties of Visual Studio:

Select Text and click on the drop down arrow at right end
now type first line and press Enter
then type 2nd line and  press Enter
follow the above steps

by code:

            label2.Text = "Line1\r\nLine 2";
            label3.Text = "L3 Line 1" + Environment.NewLine + "L3 Line 2";
            label4.Text = "L4Line 1 \n L4Line 2";

Md. Ahdabul Islam

Ahdabul Islam
M.Engg. (ICT)
Re: c# Label Multiline
Posted By Lalit M on 03 Feb 2010  
In visual studio we dont have a option to make label Multiline as textbox.
We can make a textbox to looklike multiline label:

1. Drag and Drop a Textbox on to your Form
2. Goto Properties window to that Textbox
3. Set Multiline Property to True
4. Set BorderStyle to None
5. Set BackColor to Control
6. Set ReadOnly to True

more info you will better undersated.

Please check my answer if you help.....

Thanks ....Lalit.

Re: c# Label Multiline
Posted By Thomas on 26 Jun 2012  
You could change the property Autosize to false, that way you can adjust the size anyway you want.
C# Corner Annual Conference 2016


Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.