I have an application in which i am generating status messages frequently. I am printing all these messages to message box. Instead of using message box i want to use list box or multi line text box . How should i proceed.
void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e)
{
publishstatusTextbox.Items.Insert(0, DateTime.Now.ToString("hh:mm:ss:fff") + "MessageID=");
}
I'm getting following exception
cross thread operation not valid "publishstatusListbox" is accessed from the thread other than the thread it was created on