I got this error when trying to update an image. It was a cross-thread update, but I used .Invoke(), so that shouldn’t be the problem, should it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(Answering my own question, for others, and for future reference)
I think (not yet entirely sure) that this is because InvokeRequired will always return false if the control has not yet been loaded/shown. I have done a workaround which seems to work for the moment, which is to simple reference the handle of the associated control in its creator, like so:
(See http://ikriv.com:8765/en/prog/info/dotnet/MysteriousHang.html – down? cached version)
(Related question: Boiler plate code replacement – is there anything bad about this code?)