public static void ShowForm(IWin32Window owner = null, bool start_center = false) { if (formWait.form != null) return; try { formWait.form = new formWait(); formWait.form.Location = formWait.GetStartingLocation(); if(start_center) formWait.form.StartPosition = FormStartPosition.CenterScreen; formWait.form.Show(owner); formWait.form.Refresh(); } catch (Exception e) { } return; }
public static void HideForm() { if (formWait.form == null || !formWait.form.IsHandleCreated) return; try { formWait.form.Invoke((MethodInvoker)delegate { if (formWait.form.Visible) formWait.form.Close(); }); formWait.form = null; } catch (Exception e) { // TODO: 11/23/15 implement exception handling } return; }