M
Mesan
I'm getting a "Cross-thread operation not valid" Exception and I can't
figure out why.
I've got a BackgroundWorker that creates a UserControl with a whole lot
of other user controls inside of it, full of data I'm getting from the
database. When my background worker completes I take e.Result and cast
it back into a UserControl. I create a TabPage, add the returned
UserControl to the Controls of the new TabPage and *BAM* there's my
exception.
Just before I add the UserControl to the new TabPage's Controls I've
looked at the InvokeRequired properties for the UserControl, the new
TabPage and even my main form and they're all false, leading me to
believe that I should't expect to see such a cross-thread operation.
What gives?
figure out why.
I've got a BackgroundWorker that creates a UserControl with a whole lot
of other user controls inside of it, full of data I'm getting from the
database. When my background worker completes I take e.Result and cast
it back into a UserControl. I create a TabPage, add the returned
UserControl to the Controls of the new TabPage and *BAM* there's my
exception.
Just before I add the UserControl to the new TabPage's Controls I've
looked at the InvokeRequired properties for the UserControl, the new
TabPage and even my main form and they're all false, leading me to
believe that I should't expect to see such a cross-thread operation.
What gives?