How to add a line to a multiline TextBox?

后端 未结 10 638
情话喂你
情话喂你 2020-12-01 15:32

How can i add a line of text to a multi-line TextBox?

e.g. pseudocode;

textBox1.Clear();
textBox1.Lines.Add(\"1000+\");
textBox1.Lines.Add(\"750-999\         


        
10条回答
  •  感动是毒
    2020-12-01 16:15

    Above methods did not work for me. I got the following exception:

    Exception : 'System.InvalidOperationException' in System.Windows.Forms.dll
    

    Turns out I needed to call Invoke on my controls first. See answer here.

提交回复
热议问题