Telerik blogs

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();


About the Author

Iana Tsolova

is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.

Related Posts

Comments

Comments are disabled in preview mode.