Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I wnt to knw how it is possible to create a multiline Label???

I just tried the code
label.Text="Multiline"+System.Environment.NewLine+"Label";

but its not working.
Cheers,
ParvathySunu
Posted
Updated 25-May-11 21:24pm
v2
Comments
ambarishtv 26-May-11 3:21am    
its working !!!
Sergey Alexandrovich Kryukov 26-May-11 3:30am    
If it's working, post as a solution, but better wait until OP tags what is the library.
--SA
Sergey Alexandrovich Kryukov 26-May-11 3:25am    
Tag it! WPF, Forms, what?
--SA

1 solution

A label can handle new lines.
So simply try
label.Text = "First line" + Environment.NewLine + "Second line"
 
Share this answer
 
Comments
Sandeep Mewara 26-May-11 10:50am    
And I have no clue who and why this was 1-voted!
Countered 5!
Abhinav S 26-May-11 14:43pm    
Thank you Sandeep.
Sergey Alexandrovich Kryukov 26-May-11 14:19pm    
My 5. Funny, this is what OP written in first place; however the answer is accepted.
--SA
Abhinav S 26-May-11 14:43pm    
Thank you SA.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900