0

I'm attempting to make a screensaver with a Windows Form App. It's almost working correctly, but for whatever reason, it will not show on all of the screens, just one of them.

foreach (Screen screen in Screen.AllScreens)
{
    Screensave screensaver = new Screensave(screen.Bounds);
    screensaver.Show();
}

Now this creates the correct amount of instances of the program. But all of them are on only one of my screens, and I'm not sure why.

Lionmeow
  • 79
  • 6
  • This post describes a few useful moments: [Showing a Windows form on a secondary monitor?](https://stackoverflow.com/questions/1363374/showing-a-windows-form-on-a-secondary-monitor). It is necessary to set `form.StartPosition = FormStartPosition.Manual` – Jackdaw Oct 11 '20 at 08:57
  • Read the notes here about the VirtualScreen: [Using SetWindowPos with multiple monitors](https://stackoverflow.com/a/53026765/7444103), to also select, in different ways, where a window should be presented. Don't skip the DpiAwaress part. – Jimi Oct 11 '20 at 09:03

1 Answers1

0

I can only guess without knowing the Screensave code. My guess is the the Show function, is opening a Dialog

As you can see here, the function returns a result

public System.Windows.Forms.DialogResult ShowDialog();

If that's the case your loop will pause screensaver.Show(); until you close the dialog.

Athanasios Kataras
  • 25,191
  • 4
  • 32
  • 61