Add NewLine to label's Text at design time Add NewLine to label's Text at design time windows windows

Add NewLine to label's Text at design time


When you click on the label Text property in the Property window for the label, a drop down will appear in which you can, when you press Enter, go to the new line. I just tried it, and it works in Visual Studio 2010.

Here's a screenshot to clarify:

Editing multiline label


Design Time \r\n will do the trick -

      label1.Text = "Multi-line \r\nlabel"

Also you can try setting in designer generated code -

        this.label2.Location = new System.Drawing.Point(151, 120);        this.label2.Name = "label2";        this.label2.Size = new System.Drawing.Size(35, 13);        this.label2.TabIndex = 1;        this.label2.Text = "Multi-line \r\n label";

Run time -

      label1.Text = "Multi-line" + Environment.NewLine + "label";


You can use <br /> in your string, for example :

MyLabel.Text = "This is my text" + "<br />" + "This is my new line text";