How to acces a textbox in form1 from another class

I am trying to seprate my code up, in classes. I have a form1 that contains some textforms. i have then made a public void, that contains the code i want to run. It says

An object reference is required for the non-static field, method, or property 'Form1.textBox_email'

the textbox has ben set to public, under modify.

the code looks like this.

teststring = teststring.Replace("###EMAILADR###", Form1.textBox_email.Text);

by gravballe via /r/csharp

Leave a Reply