Cannot Assign because it is a method group C#?

后端 未结 6 528
温柔的废话
温柔的废话 2021-01-01 17:02

Cannot Assign \"AppendText\" because it is a \"method group\".

public partial class Form1 : Form
{
    String text = \"\";

    public Form1()
    {
                 


        
6条回答
  •  庸人自扰
    2021-01-01 17:49

    Do this instead (AppendText is a method, not a property; which is exactly what the error message is telling you):

    textBox2.AppendText(text);
    

提交回复
热议问题