I have a program which displays a dialog box(which is a new form).
Now what i want is to stop the execution of the program until user has entered password and pressed Ok Button on the other form.
Problem is whenever i display the dialog box. The underlying program doesnt stop execution and continues anyway.
How can i stop the execution of program until user has entered username and password and submitted them to the main form.
Use
otherForm.ShowDialog()method when displaying other form to user:Form.ShowDialog method shows the form as a modal dialog box. When this method is called, the code following it is not executed until after the dialog box is closed.