Пример #1
0
        public void ShowDialog(IWin32Window owner)
        {
            DummyForm form = new DummyForm(this);

            form.Show(owner);
            Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
            form.WatchForActivate = true;
            try
            {
                dlgOpen.ShowDialog(form);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            form.Dispose();
            form.Close();
        }
Пример #2
0
        public DialogResult ShowDialog(IWin32Window owner)
        {
            DialogResult returnDialogResult = DialogResult.Cancel;
            DummyForm    form = new DummyForm(this);

            form.Show(owner);
            Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
            form.WatchForActivate = true;
            try
            {
                returnDialogResult = dlgOpen.ShowDialog(form);
            }
            // Sometimes if you open a animated .gif on the preview and the Form is closed, .Net class throw an exception
            // Lets ignore this exception and keep closing the form.
            catch (Exception) {}
            form.Close();
            return(returnDialogResult);
        }
Пример #3
0
        public DialogResult ShowDialog(IWin32Window owner, string filename)
        {
            DummyForm form = new DummyForm(this);

            form.Show(owner);
            Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
            form.WatchForActivate = true;
            DialogResult r = DialogResult.None;

            dlgOpen.FileName = filename;
            try
            {
                r = dlgOpen.ShowDialog(form);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            form.Dispose();
            form.Close();
            return(r);
        }
Пример #4
0
        public DialogResult ShowDialog(IWin32Window owner)
        {
            DialogResult res = DialogResult.None;

            DummyForm form = new DummyForm(this);

            form.Show(owner);
            Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
            form.WatchForActivate = true;
            try
            {
                res = dlgSave.ShowDialog(form);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            form.Dispose();
            form.Close();

            return(res);
        }
Пример #5
0
 public DialogResult ShowDialog(IWin32Window owner, string filename)
 {
     DummyForm form = new DummyForm(this);
     form.Show(owner);
     Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
     form.WatchForActivate = true;
     DialogResult r = DialogResult.None;
     dlgOpen.FileName = filename;
     try
     {
         r = dlgOpen.ShowDialog(form);
     }
     catch(Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     form.Dispose();
     form.Close();
     return r;
 }
Пример #6
0
 public void ShowDialog(IWin32Window owner)
 {
     DummyForm form = new DummyForm(this);
     form.Show(owner);
     Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
     form.WatchForActivate = true;
     try
     {
         dlgOpen.ShowDialog(form);
     }
     catch(Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     form.Dispose();
     form.Close();
 }
 public DialogResult ShowDialog(IWin32Window owner)
 {
     DialogResult returnDialogResult = DialogResult.Cancel;
     DummyForm form = new DummyForm(this);
     form.Show(owner);
     Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
     form.WatchForActivate = true;
     try
     {
         returnDialogResult = dlgOpen.ShowDialog(form);
     }
     // Sometimes if you open a animated .gif on the preview and the Form is closed, .Net class throw an exception
     // Lets ignore this exception and keep closing the form.
     catch(Exception){}
     form.Close();
     return returnDialogResult;
 }
Пример #8
0
        public DialogResult ShowDialog(IWin32Window owner)
        {
            DialogResult res = DialogResult.None;

            DummyForm form = new DummyForm(this);
            form.Show(owner);
            Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
            form.WatchForActivate = true;
            try
            {
                res = dlgSave.ShowDialog(form);
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            form.Dispose();
            form.Close();

            return res;
        }