[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 726
  • Last Modified:

How do I make a label multi-line?

I need to make a text label multi-line using WinForms C# 3.5

Thanks,
newbieweb
0
newbieweb
Asked:
newbieweb
2 Solutions
 
nmarunCommented:
try this:

string labelText =  string.Format("This is line 1.{0}This is line 2.", Environment.NewLine);

label1.Text = labelText;
0
 
Fernando SotoCommented:
Hi newbieweb;

use the \n when you want to begin a new line.

label1.Text = "This is the first line \nThis is a second line\nThis is the Third line";

Fernando
0
 
newbiewebAuthor Commented:
Environment.NewLine is new to me.

Thanks,
newbieweb
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now