0

I really appreciate your help and contribution in advance, I am training on C# home and it's been great way to do something with home time: I am trying to append a string of text to txtCollectionBox from txtNoteBox and a new line at the end of each string of text from txtNoteBox. But it's appending on the same line, not a new line - does anyone know why?

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();
    }
}
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

3

Try removing \n and replacing it withEnvironment.NewLine. (or maybe it is System.Environment.NewLine I don't remember.)

Mahmood Darwish
  • 536
  • 3
  • 12