web analytics

How to set the line break character in the Text properties of Label?

Options

codeling 1602 - 6666
@2016-01-06 09:17:28

In a Windows form, you can use Environment.NewLine to break the text in two line:

label1.Text = "First line" + Environment.NewLine + "Second line";

In a ASP.NET webform page, you can use <br /> in the text:

label1.Text = "First line<br />Second line";

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com