Roy

Roy

  • NA
  • 6
  • 0

System.InvalidOperationException

Jul 16 2006 10:06 PM

I am having a problem with a System.InvalidOperation exception.  There is a combo box in my code and when the index is changed i have a a treeview item that is cleared and then rebuilt.  However, when I go to add the first node I receive the following exception:

 

System.InvalidOperationException: Action being performed on this control is being called from the wrong thread.  Marshall to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.

I only have one thread in my code and it is the Main form default thread.  Furthermore, the exception does not always occur.  It occurs randomly.  The specific line to which to error is returned is the line at which I am adding my first node to my tree.  I have no idea why this exception is being thrown.


Answers (1)