I just want to find out how to run two WPF windows (one in extended desktop) while开发者_运维技巧 in Full screen mode.
Add System.Windows.Forms.dll and System.Drawing.dll references and try this:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
foreach (var screen in System.Windows.Forms.Screen.AllScreens)
{
var window = new Window1
{
WindowStartupLocation = WindowStartupLocation.Manual,
WindowState = WindowState.Maximized,
WindowStyle = WindowStyle.None,
Title = screen.DeviceName,
Width = screen.Bounds.Width,
Height = screen.Bounds.Height,
Left = screen.Bounds.Left,
Top = screen.Bounds.Top,
};
window.Show();
}
}
}
Don't forget to remove StartupUri="Window1.xaml" from App.xaml.
精彩评论