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.
Loading

Nainil148 reputationPosted Feb 3, 2010, 5:13 AM EST
class SpecificDistributor : Distributor
{
public SpecificDistributor();
public RichTextBox oRichTextBox { get; set; }
public override void start()
{
oRichTextBox.AppendText("from my seperate class\n");
}
}
In FormLoad event, do this:
SpecificDistributor oSpecificDistributor = new SpecificDistributor();
oSpecificDistributor.oRichTextBox = this.RichTextBox1;
Hope this helps.
Joakim Astrom19 reputationPosted Feb 8, 2010, 3:00 AM EST
Thanks.