How to get Screen Object that the an application is run from?

  • Thread starter Thread starter Schorschi
  • Start date Start date
S

Schorschi

If I run my application from the explorer on my 2nd monitor, the
screen object reported via Screen.FromControl(theForm).Bounds is the
primary screen bounds not the screen that my application is really
started from. I guess I could capture the mouse position and use
Screen.FromPoint().Bounds, but is that the best way to do this?

I do not have a parent form to use in this case, because it is the
first form created. Creating an invisible form just center the first
form via CenterScreen of parent seems really bad.
 
CenterScreen actually works the way you said, it captures the mouse location
and calls the Screen.FromPoint() to determine which screen the form should
be centered on.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
 
Back
Top