Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a form modal in Windows Forms?

I'm trying to create a child form that helps the user to enter data for a field in the parent form. I want this child form to be modal, but what do I need to do to make this form modal?

Is there's a different type of item I need to use?

like image 453
Ben McCormack Avatar asked Mar 23 '10 19:03

Ben McCormack


People also ask

Can you put a form in a modal?

You can place the Login and Signup form right in the same Modal. This way, the user triggers the modal, then can either login or register right from that modal. Another way you might try this is to simply provide links to both the Login and Signup pages of your website in the Modal.

How do you show a modal form?

Forms that are displayed modally are typically used as dialog boxes in an application. You can use this property to determine whether a form that you have obtained from a method or property has been displayed modally. To display a form modally use the ShowDialog method.


1 Answers

Use Form.ShowDialog()

As Bob mentioned, you should set Form.DialogResult accordingly on your modal form.

like image 121
Jon B Avatar answered Sep 24 '22 14:09

Jon B