Vijay P.V
Vijay P.V

Reputation: 145

Line break in Label Box

How can I give line break in label box using C#?

Here is my code is there to show the values from database in a label box:

protected List<string> restwo;
lblKeyword.Text =  restwo[17];

Here I create a list for showing the data from database. restwo is an array variable and I am assigning to label box whatever is in the array list. In this array list, I am using this:

"t, applet, class, money, July, you, clue, collection, Java, add, add, add, club, dildos, class, class, applet, t, your, Java, Java, add, collection"

It will show a very lengthy label text. This will be a problem for my design. Here I want include a line break. How can I achieve this?

Upvotes: 2

Views: 1130

Answers (1)

Vijay Hulmani
Vijay Hulmani

Reputation: 979

Use "\r\n" or br at appropriate places. for example: In winforms for label

label1.text= "t, applet, class, money, July, you, clue, collection,"+"\r\n"+"Java, add, add, add, club, dildos, class, class, applet, t";

Upvotes: 2

Related Questions