A
AMP
Hello,
I have a class that has a calls a method in a form to set some text
on that form:
This is in a Class SerialPortConnection.cs.
I have an object called NewConnection.
I want to pass some text to a form with this:
Form1.UpdateTextBox1(" Port Open\r\n");
Here is my Form Method:
internal static void UpdateTextBox1(string p)
{
textBox1.AppendText(p);
}
How do I do this?.
I am getting this error:
An object reference is required for the nonstatic field, method, or
property 'Bubbler.Form1.textBox1'
I tried this.textBox1.AppendText(p);
I tried Form1.textBox1.AppendText(p);
Nothig is working.
Any Help
Thanks
I have a class that has a calls a method in a form to set some text
on that form:
This is in a Class SerialPortConnection.cs.
I have an object called NewConnection.
I want to pass some text to a form with this:
Form1.UpdateTextBox1(" Port Open\r\n");
Here is my Form Method:
internal static void UpdateTextBox1(string p)
{
textBox1.AppendText(p);
}
How do I do this?.
I am getting this error:
An object reference is required for the nonstatic field, method, or
property 'Bubbler.Form1.textBox1'
I tried this.textBox1.AppendText(p);
I tried Form1.textBox1.AppendText(p);
Nothig is working.
Any Help
Thanks