Cool Guy wrote:
>Is it possible to insert a carriage return in a WinForms Label's Text with
>the VS.NET WinForms Designer?
>
>(Including '\n' doesn't work -- that gets converted to '\\n'.)
I think it's not possible to do this by editing the text in the property
grid. But you can (carefully!) edit the designer generated code and change
the text. One possibility is to insert \n's, like this:
this.label.Text = "Text\nSecond line";
The other is to use verbatim literals like this:
this.label.Text = @"Text
Second line";
In the latter case, be sure to break the line in the place where you want
the linebreak!
In both cases, be aware that if you change the text in the property grid
afterwards, the designer will lose your manual changes. You're fine as
long as you don't make any changes to the text.
Oliver Sturm
--
Expert programming and consulting services available
See
http://www.sturmnet.org (try /blog as well)