Saturn
Saturn

Reputation: 18169

Total focus on a Form: ignore all others

in my VB.NET application, my main Form can show other Forms. That works fine, but I need to set "focus" on the newly opened form, and don't allow the user use the main form until the opened Form is closed. How do I do that?

Upvotes: 1

Views: 2817

Answers (2)

Choosen1one
Choosen1one

Reputation: 11

Use the Form.ShowDialog() method.

It will show you the form as a dialog box, so focusing is at total, and it will ignore all other forms or objects.

Upvotes: 1

Justin Denton
Justin Denton

Reputation: 581

The Form.ShowDialog() method shows a form as a dialog box; this should keep the focus on that form until it is closed (by the user or your code).

Upvotes: 4

Related Questions