Techie Talks

Thursday, April 14, 2005

Newline in C# TextBox

To insert a new line in C# TextBox, "\r\n" or System.Environment.NewLine must be used and NOT just "\n". That is, a new line is a carriage return followed by a line feed, analogous to what we have in conventional type writers.

MyTextBox.Text = "Hello\r\nWorld";
MyTextBox.Text = "Hello" + System.Environment.NewLine+"World";

works, but NOT

MyTextBox.Text = "Hello\nWorld";

Wednesday, April 13, 2005

C to C#

Here is a link to an MSDN Page that has some .NET Framework equivalent for C runtime functions