Tuesday, December 02, 2008
by
ASP.NET AJAX Team
|
Comments 4
When we have a running application and we want to show a modal dialog window what we generally do is more or less the following:
var window = new MyDialogWindow();
window.ShowDialog();
Doing that works great - the dialog window shows and is modal. It has just one tiny defect - if you switch from the running application to another one (i. e. using Alt + Tab) and then come back to the running app the modal dialog window is not showing and the app is inactive.
The solution - just assign the parent window to the Owner property of your modal dialog window :
var window = new MyDialogWindow();
window.Owner = this;
window.ShowDialog();
...