Archive for febrero 15th, 2012

Sacar ventana de WPF en otro monitor

Desde el evento Loaded de la ventana llamamos al siguiente código

privatevoid ShowInMonitor(int screen)

{

this.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;

this.Left = System.Windows.Forms.Screen.AllScreens[screen].Bounds.Left;

this.Top = System.Windows.Forms.Screen.AllScreens[screen].Bounds.Top;

this.Width = System.Windows.Forms.Screen.AllScreens[screen].Bounds.Width;

this.Height = System.Windows.Forms.Screen.AllScreens[screen].Bounds.Height;

this.WindowState = WindowState.Maximized;

this.Topmost = true;

WindowState = System.Windows. WindowState.Maximized;

this.Show();

}

 

Powered by WordPress | Compare the Best Cell Phones at Bestincellphones.com. | Thanks to CD Rates, 0 credit cards and Home Information Packs