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.

Example:
MyTextBox.Text = "Hello\r\nWorld";
and
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
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrfRun-TimeRoutinesNETFrameworkEquivalents.asp