2
Answers

Accessing Form elements from separate class

Ask a question
Joakim Astrom

Joakim Astrom

14y
3.9k
1

Hello people.
I am wondering if it is possible to somehow access my richtextbox from a separate class I am using. The project is a Windows Forms Application.
 
namespace
WebCrawer1._1
{
      class SpecificDistributor : Distributor
      {
            public SpecificDistributor() { }
            public override void start()
            {
                     richTextBox1.appendText("from my separate class\n");
            }
      }
}
 
The SpecificDistributor class inherits the Distributor class. But how can I "link" the SpecificDistributor class to access the elements from my Form directly? In this case I just want to be able to logg information in the richTextBox of my Forms Application from my separate class.
Thanks.

Answers (2)