views:

306

answers:

3

I am working on a .NET application that displays multiple charts. My users would like an easy way to say "take chart #3 and maximize it on my fourth monitor".

How can I determine the number of monitors so I can give them a selection of "monitor #1, monitor #2, etc"? (Not every user has the same number of monitors.)

And once the user has selected a particular monitor, how can I use that information to position the chart they're trying to maximize?

+3  A: 

The Screen class helps you a lot by finding the available screens.

When you "maximize" a form, the form will automatically maximize to the size of the Screen the form is in.

You can position it yourself, or let Windows take care of it, by just placing the form on the right "Screen", and maximizing it. Or use the WorkingArea of the screen, and fill that yourself.

GvS
A: 

Try the Screen class in System.Windows.Forms. The AllScreens static member contains the list of all screens attached to the system. Once you choose a screen, you can use the Bounds member to decide how to maximize a window to that screen.

Charlie
A: 

Use SystemInformation.MonitorCount and other methods from this class.

Sijin