P
Pieter Coucke
Hi,
In my VB.NET 2005 application I'm generating and sending emails using the
outlook-object model (2003). When a mail is Send (MailObject_Send), I raise
an event in a global class, that is caught by all my forms that than refresh
the lists with emails.
But on the moment I do a MyDataGrid.DataSource = nothing, I get this
"Cross-thread operation not valid"-exception:
The problem is: I'm not using delegates, backgroundworkers or whatever! Why
does this happen? and what is the solution?
Thanks a lot in advance,
Pieter
The full exception:
A first chance exception of type 'System.InvalidOperationException' occurred
in System.Windows.Forms.dll
Additional information: Cross-thread operation not valid: Control ''
accessed from a thread other than the thread it was created on.
In my VB.NET 2005 application I'm generating and sending emails using the
outlook-object model (2003). When a mail is Send (MailObject_Send), I raise
an event in a global class, that is caught by all my forms that than refresh
the lists with emails.
But on the moment I do a MyDataGrid.DataSource = nothing, I get this
"Cross-thread operation not valid"-exception:
The problem is: I'm not using delegates, backgroundworkers or whatever! Why
does this happen? and what is the solution?
Thanks a lot in advance,
Pieter
The full exception:
A first chance exception of type 'System.InvalidOperationException' occurred
in System.Windows.Forms.dll
Additional information: Cross-thread operation not valid: Control ''
accessed from a thread other than the thread it was created on.