I'm new to WPF so this is probably a pretty easy problem. I open a dialog window using ShowDialog(). Then, if I click into another window that's fullscreen or just covers my dialog, it's difficult to get back to the dialog. The icon that shows up in the taskbar takes me back to the main WPF window but the dialog stays hidden behind the other window. I either have to minimize the blocking window or Alt-Tab back into my application (which will show the dialog but leave the main window hidden).
The definition for the window looks like:
<Window x:Class="MyProject.MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ResizeMode="CanResizeWithGrip"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
Width="750"
Height="565"
Title="MyWindow">
I'm opening it like:
var dlg = new MyWindow();
if (dlg.ShowDialog() != true)
return;
You can do this by pressing Alt+Tab until that window is active or clicking the associated taskbar button. After you've got the window active, Shift+right-click the taskbar button (because just right-clicking will open the app's jumplist instead) and choose the “Move” command from the context menu.
You can bring hidden dialog boxes to the front using the Windows task bar or by pressing Alt-Tab to scroll through open windows and dialog boxes. You can also ensure that dialogs do not go behind the VSA main window by selecting the Keep dialogs on top of Main Window option in the Display Preferences Window tab.
Press ALT + SPACEBAR on the keyboard. Press the M key and tap any ARROW keys. Move the mouse to bring the window into view. Click the left mouse button to cancel the operation.
You should set the owner of your dialog window. Something like this.
var dlg = new MyWindow();
dlg.Owner = this;
if (dlg.ShowDialog() != true)
return;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With