How do I stop the program until a form is closed?

0

I want it when Form1 is opened, the whole program stops, and only comes back when it is closed. How can I do this?

Code that opens Form1:

if (x == DialogResult.Yes)
{
    Form1 f1 = new Form1();
    f1.Show();
}

As it's called:

public static bool testprocess()
{
    Config.Txtconfig();
    return true;
}

If I were able to return the value only when the Config.Txtconfig() function ended, I think it would solve my problem, but I do not know how to do it either.

    
asked by anonymous 28.05.2017 / 18:12

1 answer

0

To "lock" the application while waiting for the result of Form1, change the .Show to .ShowDialog ();

That part of the testprocess I did not understand.

    
28.05.2017 / 19:42