I have the following code in my WinForms C# app:-
private static void displayTime(object source, ElapsedEventArgs e)
{
timer++;
timeTxtBox.Text = parseTime(timer);
}
This is throwing an InvalidOperationException
with the message, with the details
Cross-thread operation not valid: Control 'timeBox' accessed from a thread other than the thread it was created on.
How would I make this work?