无法在Windows Forms C#中添加新行

问题描述 投票:0回答:1

[我非常感谢您的帮助和帮助,我正在C#home上进行培训,这是做家乡时间的好方法:我正在尝试从txtCollectionBox和[ txtNoteBox中每个文本字符串末尾的一行。但这是附加在同一行上,而不是新行上,有人知道为什么吗?

txtNoteBox
c# textbox appendtext
1个回答
1
投票

尝试删除private void btnAddNote_Click(object sender, EventArgs e) { if (txtNoteBox.Text == "") { MessageBox.Show("Please Add a Note"); } else { txtCollectionBox.AppendText("[*] " + txtNoteBox.Text + " ." + "\n"); txtNoteBox.Clear(); } } ,然后将其替换为\n。 (或者也许是我不记得的Environment.NewLine。)

© www.soinside.com 2019 - 2024. All rights reserved.