Reputation: 18169
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
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
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