E
EsCHEr
I created a class
public class testClass
{
public testClass()
{
}
public void changeForm(){
Form1.textBox1.Text = "hello";
}
}
And on Form1 I declared it and I called changeForm
[code:1:c279a06ed5]testClass myTest;
this.myTest = new testClass();
this.myTest.changeForm();[/code:1:c279a06ed5]
And I get this error
error CS0120: An object reference is required for the nonstatic field,
method, or property 'testCallFromClass.Form1.textBox1'
Both classes are in the same namespace
Any Ideas?[code:1:c279a06ed5][/code:1:c279a06ed5]
public class testClass
{
public testClass()
{
}
public void changeForm(){
Form1.textBox1.Text = "hello";
}
}
And on Form1 I declared it and I called changeForm
[code:1:c279a06ed5]testClass myTest;
this.myTest = new testClass();
this.myTest.changeForm();[/code:1:c279a06ed5]
And I get this error
error CS0120: An object reference is required for the nonstatic field,
method, or property 'testCallFromClass.Form1.textBox1'
Both classes are in the same namespace
Any Ideas?[code:1:c279a06ed5][/code:1:c279a06ed5]