How do I find what screen the application is running on in C#

c#, screen, winforms

Solution

This should get you started. Get a Button and a listbox on a Form and put this in the Button_Click:

listBox1.Items.Clear();
foreach (var screen in Screen.AllScreens)
{
    listBox1.Items.Add(screen);
}
listBox1.SelectedItem = Screen.FromControl(this);            

The answer is in the last line, remember that a Form is a Control too.

Problem

How do I determine what screen my application is running on?

Original source