Hi,

The language that I'm using is C++. 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!