public void Off() { if (LoadPictureBox.InvokeRequired) { LoadPictureBox.BeginInvoke(new Action(Off)); return; } Close(); }
public void On() { if (LoadPictureBox.InvokeRequired) { LoadPictureBox.BeginInvoke(new Action(On)); return; } new Thread(() => { ShowDialog(); }).Start(); }