private void DoUIEvents() { if (_dialog.InvokeRequired) { _dialog.Invoke((Action)(() => { // do nothing })); } else { Application.DoEvents(); } }