Why do it this way (even though it's doable). IMO the proper way would be to call the class from the form and send the contents of the textbox to the method of the class. The method can also return data . So basically you could have in your form code like:
MyClass instance = new MyClass()
TextBox1.Text = instance.GetText();
and the class:
public class MyClass {
public string GetText() {
return "text";
}
}
Depending on the situation the class and the method could also be static when no instantation would take place.
Addition (
not advisable):
Passing the form as a parameter, the calss:
public class MyClass {
public void SetText(Form1 formInstance) {
formInstance.TextBox1.Text = "Text";
}
}
And calling:
MyClass instance = new MyClass()
instance.SetText(this);