locked
Modal Form using RunForm? RRS feed

  • Question

  •  

    Hi all,

    Is it possible to start a form modally using RunForm

     

    Thanks.

    Tuesday, November 20, 2007 9:32 PM

Answers

  • Hi,

     

    you make a form modal by callings its ShowDialog method. You have to do this on the winforms thread (through FormInvoke) because ShowDialog blocks its calling thread until the form is closed:

     

    WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        Form form = new Form();
                        form.Text = "I'm modal";
                        form.ShowDialog();
                    }
                );

     

    Hope this helps,

     

    Andreas

     

    Thursday, November 22, 2007 12:55 AM