See Also: http://stackoverflow.com/questions/725735/how-to-enable-a-timer-from-a-different-thread-class
The timer is assigned to a form and I'd like to Enable it at a specific location,but from another class.I don't want to make it public
This is the code I use to access memo
public string TextValue
{
set
{
if (this.Memo.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate
{
this.Memo.Text += value + "\n";
});
}
else
{
this.Memo.Text += value + "\n";
}
}
}
public static void addtxt(string txt)
{
var form = Form.ActiveForm as Form1;
if(form != null)
form.TextValue = txt;
}