NoWar
NoWar

Reputation: 37633

Which monitor is active?

I run my application under the primary monitor and sometimes under the secondary monitor/TV.

And that application does a screenshot.

The question is how I can know which monitor IS CURRENT: primary or secondary do generate A SCREENSHOT?

Have I use some of the those things?

Screen.PrimaryScreen.Bounds.X 
Screen.AllScreens[1].Bounds.X 

Upvotes: 2

Views: 1548

Answers (2)

SwDevMan81
SwDevMan81

Reputation: 49978

You can use the Screen.FromControl

bool isOnPrimaryMonitor = Screen.FromControl(this).Primary;

For WPF, use Screen.FromHandle, where this is a Window:

Screen.FromHandle(new WindowInteropHelper(this).Handle);

Upvotes: 6

Likurg
Likurg

Reputation: 2760

I think this will help you Multi-monitor-programming

Upvotes: 2

Related Questions