Newline in a TextBox
C#
3
Posts
3
Posters
0
Views
1
Watching
-
The textbox is already set to MultiLine = true; How can I move to a new line in a textbox using code? Thanks
-
The textbox is already set to MultiLine = true; How can I move to a new line in a textbox using code? Thanks
myTextBox.Text += "This is a new line" + "\r\n"; This means: The box uses both new-line and carriage-return characters to determine where each line ends. Cheers Sid
-
The textbox is already set to MultiLine = true; How can I move to a new line in a textbox using code? Thanks
You can either append "\r\n" to your Text or append the string returned by
Environment.NewLine
. Using theEnvironment.NewLine
is preferred for code portability. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome