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.

Donations appreciated. Every little $ helps. Or click Google +1. Or play the short video on the upper right of this page.

Related Posts Plugin for WordPress, Blogger...

tags: ,

  1. One Response to “C#: Newline In Label Control”

  2. 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

    By Cameron on Dec 13, 2011

Post a Comment