winforms应用程序中的TextBox MultiLine

Lam*_*fif 0 .net c# string escaping winforms

如何在winforms应用程序中的文本框中插入新行:

 textBox2.Text += "a";
 textBox2.Text += "\n";
 textBox2.Text += "b"; 
Run Code Online (Sandbox Code Playgroud)

但我得到一行,即使我使文本框多行:

我该如何解决这个问题?

Ami*_*ich 5

使用 Environment.NewLine

textbox.Multiline = true;
textbox.Text += "a" + Environment.NewLine + "b";
Run Code Online (Sandbox Code Playgroud)