Search code examples
c#.netwinforms.net-3.5.net-2.0

How do I determine which monitor my winform is in?


I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine which montitor a form is currently in?


Solution

  • A simpler method than using the bounds is to use the Screen.FromControl() method. This is the same functionality that Windows uses.

    Screen.FromControl(this)
    

    will return the screen object for the screen that contains most of the form that you call it from.