Cannot Assign \"AppendText\" because it is a \"method group\".
public partial class Form1 : Form
{
String text = \"\";
public Form1()
{
You have to call the AppendText in this way:
textBox1.AppendText("Some text")
Use following
textBox2.AppendText(text);
Instead of
textBox2.AppendText = text;
AppendText is not a property but a method. Thus it needs to be invoked with parameter and cannot be assigned directly.
Properties are special methods, that support assignments due to special handling in compiler.
Do this instead (AppendText is a method, not a property; which is exactly what the error message is telling you):
textBox2.AppendText(text);
I figured out that the variable name declared was similar to a method name and hence it didn't allow me to assign a value.
The moment I changed the name it worked!
AppendText is a method and you must call it.
textBox2.AppendText(text);
textBox2.AppendText(text); is a method. You have to call it like one. You were performing an assignment operation on a method.