Newline in Label Text
-
Greets all, How do you get a newline in Text property of a Label control? I've tried \n and \r\n but neither work. Any suggestions? .:. Keno .:.
-
Greets all, How do you get a newline in Text property of a Label control? I've tried \n and \r\n but neither work. Any suggestions? .:. Keno .:.
You would have to owner-draw (i.e., override
OnPaint
) to accomplish such a thing. A common work-around is to use a multi-lineTextBox
withReadOnly
set totrue
and no border. Then you can useEnvironment.NewLine
(portable code should never hard-code carriage returns and/or line feeds).Microsoft MVP, Visual C# My Articles
-
You would have to owner-draw (i.e., override
OnPaint
) to accomplish such a thing. A common work-around is to use a multi-lineTextBox
withReadOnly
set totrue
and no border. Then you can useEnvironment.NewLine
(portable code should never hard-code carriage returns and/or line feeds).Microsoft MVP, Visual C# My Articles
Thanks Heath! I wonder why this functionality isn't available though, If I remeber correctly this was possible in VC wasn't it? .:. Keno .:.