Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / February 2004

Tip: Looking for answers? Try searching our database.

Label text in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sreedhar - 19 Feb 2004 01:41 GMT
Hi

 what is newline command in C#. I want to append text to a label but in 3 different lines.
Thanks in advance
Derek Harmon - 19 Feb 2004 03:13 GMT
>what is newline command in C#. I want to append text to a label but in 3 different lines..

If by "label" you mean System.WebUI.WebControls.Label, then its <BR />
as in:

   this.label1.Text = "Label <BR /> Text <BR /> in C#";

On the other hand, if you mean System.Windows.Forms.Label, then its
the escape code, \n, as follows:

   this.label1.Text = "Label \n Text \n in C#";

When using the WinForms Label class for multi-line output, remember to
set its .Size property to have a height sufficient to contain all lines.

Derek Harmon

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.