Gary Willoughby
Gary Willoughby

Reputation: 52498

How do screensavers support multiple monitors?

If i were developing a screensaver using a windows.form in C# how would i support multiple monitors? obviously i need a way to enumerate the monitors and maybe create forms for them too or just fade to black? Has anyone solved this?

Any insight would be helpful, what's the best approach?

Upvotes: 1

Views: 2708

Answers (1)

Matt Nelson
Matt Nelson

Reputation: 991

I would recommend this article from CodeProject it helped me create my first screen saver and talks about multiple monitor support.

System.Windows.Forms.Screen class has all the information you need about how many monitors and what the bounds of those monitors are. The property AllScreens would be a good place to start.

for (int i = Screen.AllScreens.GetLowerBound(0); i <= Screen.AllScreens.GetUpperBound(0); i++)
{
ScreensaverFormList[i].Bounds = Screen.AllScreens[i].Bounds;
}

Upvotes: 4

Related Questions