M
Milsnips
hi there,
i created a little test application to send out multiple emails to
addresses, but using threads.
So anyway, what i've got is 1 form with a START button, and a multiline
textbox for recording log output of sending results.
I use the code:
System.Threading.Thread t = new System.Threading.Thread(new
System.Threading.ThreadStart(doMailSend));
t.Start();
and in the function "doMailSend" i have a line:
txtLog.text += "Sending - " + DateTime.Now.ToString();
This throws an error because i'm trying to set the log textbox from within
the thread and the error is:
"Cross-thread operation not valid: Control 'txtLog' accessed from a thread
other than the thread it was created on."
any help appreciated in how to set the txtLog.text from within the function
called by the thread.
thanks,
Paul
i created a little test application to send out multiple emails to
addresses, but using threads.
So anyway, what i've got is 1 form with a START button, and a multiline
textbox for recording log output of sending results.
I use the code:
System.Threading.Thread t = new System.Threading.Thread(new
System.Threading.ThreadStart(doMailSend));
t.Start();
and in the function "doMailSend" i have a line:
txtLog.text += "Sending - " + DateTime.Now.ToString();
This throws an error because i'm trying to set the log textbox from within
the thread and the error is:
"Cross-thread operation not valid: Control 'txtLog' accessed from a thread
other than the thread it was created on."
any help appreciated in how to set the txtLog.text from within the function
called by the thread.
thanks,
Paul