I am developing an application in which a data is received from SerialPort. This data is updated on a TextView. I use the following code from another class.
_displayWindow.Invoke(new EventHandler(delegate { _displayWindow.SelectedText = string.Empty; _displayWindow.AppendText(msg); _displayWindow.ScrollToCaret(); }));
But now I will not put it in a TextView, this data will be placed in a ToolStripLabel but ToolStripLabel it has no Invoke .
Is there a way to update ToolStripLabel?
UPDATE: This is the complete method
private void DisplayData(string msg)
{
_displayWindow.Invoke(new EventHandler(delegate
{
_displayWindow.SelectedText = string.Empty;
_displayWindow.AppendText(msg);
_displayWindow.ScrollToCaret();
}));
}
I work in Framework 4.5