Hello,
Assuming you use only one computer that has several screens and you want to show your form on the second screen.
For WPF applications:
int screnToUse = 1;
Screen[] screens = Screen.AllScreens;
var formToShowToSpectators = new FormToShowToSpectators();
formToShowToSpectators.BorderThickness = new Thickness(0);
formToShowToSpectators.WindowStyle = WindowStyle.None;
formToShowToSpectators.Left = screens[screnToUse].Bounds.Left;
formToShowToSpectators.Top = screens[screnToUse].Bounds.Top;
formToShowToSpectators.Show();
For a winform Application:
int screnToUse = 1;
Screen[] screens = Screen.AllScreens;
var formToShowToSpectators = new FormToShowToSpectators();
formToShowToSpectators.FormBorderStyle = FormBorderStyle.None;
formToShowToSpectators.Left = screens[screnToUse].Bounds.Left;
formToShowToSpectators.Top = screens[screnToUse].Bounds.Top;
formToShowToSpectators.StartPosition = FormStartPosition.Manual;
formToShowToSpectators.Show();
Then because you can't maximise a window before it is loaded change it's state in the Loaded Event of your form for WPF:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
WindowState = System.Windows.WindowState.Maximized;
}
Or in the Load Event handler for WinForm:
private void FormToShowToSpectators_Load(object sender, EventArgs e)
{
WindowState = FormWindowState.Maximized;
}
You will need to add references to System.Windows.Form and System.Drawing to a WPF application
Valery