How can I resolve the following problem?
New window is shown behind after opening any other application Main window is also disabled then have to press the ALT+Tab to take the new window and close it.
NewWindow newWindow = new NewWindow (); newWindow.ShowDialog();
Set the Owner
for your second window like this:
NewWindow newWindow = new NewWindow();
newWindow.Owner = this;
newWindow.ShowDialog();
I got it correct when I gave like this:
NewWindow newWindow = new NewWindow ();
newWindow.Owner= Application.Current.MainWindow;
newWindow.ShowDialog();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.