This exception is thrown when you try to access controls from a thread other than the one it was created. To access controls and controls' properties use delegate. Its easy.
delegate void updatePictureBoxDelegate();
private void updatePictureBoxVisibilityTrue()
{
if (pictureBox1.InvokeRequired)
{
updatePictureBoxDelegate del = new updatePictureBoxDelegate(updatePictureBoxVisibilityTrue);
pictureBox1.Invoke(del, null);
}
else
{
pictureBox1.Visible = true;
}
}
call "updatePictureBoxVisibilityTrue" from your thread instead of "test" method.