Reputation: 1179
I am using Visual Studio 2013 Ultimate and have Framework 4.5.
I am new to WPF and I am creating the label dynamically I mean in back end and I want to give the break line in given text to Label.
The code I have written is:
Label lblName = new Label();
lblName.Content = "FirstName LastName";
here I want to give break line between FirstName and LastName so my output will come like.
FirstName
LastName
but not like
FirstName LastName
So how to put in between FirstName and LastName a breakline.
Upvotes: 1
Views: 264
Reputation: 2732
You could try as follows,
Label lblName = new Label();
lblName.Content = "FirstName" + Environment.NewLine + "LastName";
Upvotes: 2