Backgroundworker: picturebox.invoke error

Hi,

I have a backgroundworker to prevent my UI from crashing. However, within the background function I need to update my UI. I read that using the control's Invoke will do the trick. However, I can't seem to make it work. The code is as follows:

pictureBox2->Invoke((MethodInvoker^) delegate(){
pictureBox2->Image = btmp;
pictureBox2->Update();
});

error C2065: 'delegate' : undeclared identifier
error C2143: syntax error : missing ')' before '{'
error C2143: syntax error : missing ';' before '{'
error C2059: syntax error : ')'

Any ideas? Thanks! Any help would be greatly appreciated!
Almost nobody in this forum knows C++/CLI. For help with this Microsoft variation of the C++ language I recommend that you post your questions @ the MSDN Forums.
Topic archived. No new replies allowed.