I have a C # class library that uses a form (which is also in the library). Say I have an edit box in this form called editContents. In the usual form, I'm used to having an edit box as follows:
class MainForm { void Method() { this.editContents.Text = "Hi"; } }
I guess some kind of magic happens behind the scenes in an application with regular forms, because the edit box element is private in the MainForm class, but I can still access it as an open member.
But in my class library, I cannot access an editing window like this. I create an instance and show the form "manually" as follows:
form = new MyForm(); form.Show();
How can I get the editContents control from this form correctly ?
source share