Thursday, February 4, 2010

Multiple lines in a button C#

Problem:
How can I show multiple lines of text on a button in .NET?

Solution:
Create a string and use the Environment.NewLine to create line breaks.

button1.Text = "Hello" + Environment.NewLine + "World";

No comments:

Post a Comment