C#: Newline In Label Control

I was fooling around with the Label control in Visual Studio and I wanted the next few words to be on the 2nd line of the Label control. \n is a newline character and I expected that adding that one to the Label’s Text property, the newline would take effect. Turns out the slash and n appears as is if you do it in Visual Studio’s property box. To have a newline working in a Label Control, you would have to do it programatically. Then your \n will work.

This may hold true with other controls. If your newline character will not work when you add it within Visual Studio’s property box, try adding it programatically. I am sure it will work.

Related Posts Plugin for WordPress, Blogger...

1 comment

  1. Actually if you click on the dropdown arrow for the text in the label it will show a box with the text in it and you can simply push enter

Leave a Reply

Your email address will not be published. Required fields are marked *