"\n" is a line feed character. A line feed character alone is the line break indicator on Unix systems. On Windows systems the line break indicator is a carriage return character followed by a line feed character:
C# Code:
txtMessage.Text = "First Line Message\r\n\r\nSecond line message";
Note that Environment.NewLine will return a string containing the line break indicator for the current system. On Windows systems it will return a carriage return followed by a line feed.
If that was the problem then the TextBox could not be that size. With the Multiline property set to False the TextBox doesn't support changing the Height.
While Windows does support the use of "\n" as a line break it is basically through translation because "\r\n" is the proper line break for Windows. As such it appears that the Windows.Forms.TextBox does NOT support "\n" alone. I tested it myself and without the carriage return the TextBox will display the line feeds as place-holders only. Maybe there's a way around that but by default that's what happens.
Thanks for info JM. BramVandenbon, I think multiline property of my textbox is nothing got to do with my problem becuase it is already set to true even before I created this thread. But anyway, Thanks for the inputs.