Exception:- Cross-thread operation not valid: Control 'treeView' accessed from a thread other than the thread it was created on.
I have kept treeview, You can replace it with control of your choice
Solution
if (treeView.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate()
{
tn = treeView.SelectedNode;
});
}
This website helped me a lot http://www.daniweb.com/forums/thread285535.html
Check the solution by Farooqaaa: http://www.daniweb.com/forums/post1228357.html#post1228357
I have kept treeview, You can replace it with control of your choice
Solution
if (treeView.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate()
{
tn = treeView.SelectedNode;
});
}
This website helped me a lot http://www.daniweb.com/forums/thread285535.html
Check the solution by Farooqaaa: http://www.daniweb.com/forums/post1228357.html#post1228357
Comments
Post a Comment