J
Jarod_24
This is the exception i'm getting:
System.InvalidOperationException: The action being performed on this control is being called from the wrong thread. You must marshal
to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.
I have multiple background-threads that returns info about their progress through a Event. This event's handler is then on a Form
that has the responsability to display all the info to the user through a Treeview control.
Earlier in the development i used a textbox to see the data, and it worked without a hitch, but a treeview is a more practical
display.
The exception occurs when i try to add the nodes genereated from the recieved data (an array with some strings) to the Treeview
control itself:
treeStatus.Nodes.Add(tNode)
tNode is a node btw with some subnodes, nothing strange there.
That's when the exception occurs, but i still dont understand how to solve this?
System.InvalidOperationException: The action being performed on this control is being called from the wrong thread. You must marshal
to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.
I have multiple background-threads that returns info about their progress through a Event. This event's handler is then on a Form
that has the responsability to display all the info to the user through a Treeview control.
Earlier in the development i used a textbox to see the data, and it worked without a hitch, but a treeview is a more practical
display.
The exception occurs when i try to add the nodes genereated from the recieved data (an array with some strings) to the Treeview
control itself:
treeStatus.Nodes.Add(tNode)
tNode is a node btw with some subnodes, nothing strange there.
That's when the exception occurs, but i still dont understand how to solve this?