Reputation: 37633
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
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