Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line break issue with label control in Windows Forms

Tags:

winforms

Say I have a label control in Winforms and I want to do some thing like:

1) One
2) Two

How do I to that? If I add a "\n" to the string it does not seem to work. Is the label control inherently single line?

like image 622
Rahul Avatar asked Sep 10 '09 20:09

Rahul


People also ask

How do you put a line break in label text?

Press Shift+Enter as you type the label text to add a line break.

How do I add a new line to a label?

To add line breaks in the text we'll use \n character in the string we want to assign to the label.

What is Label in Windows form?

This feature provides keyboard navigation for a form. In addition to displaying text, the Label control can also display an image using the Image property, or a combination of the ImageIndex and ImageList properties.


1 Answers

In the Designer select the Label.
In the Label's property sheet click the Text property item. The property will display as a combo.
Expand the combo and enter your text, including line returns.

like image 154
Jay Riggs Avatar answered Oct 17 '22 08:10

Jay Riggs