namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
bool inScreen = false;
foreach (System.Windows.Forms.Screen s in System.Windows.Forms.Screen.AllScreens)
{
if (s.Bounds.Contains(this.Left, this.Top))
{
inScreen = true;
break;
}
}
MessageBox.Show(inScreen.ToString(), "In Bounds");
}
}
}