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
Joakim AstromPosted Feb 8, 2010, 8:00 AM
Thanks.
NainilPosted Feb 3, 2010, 10:13 AM
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.