/// <summary>
/// Returns whether the given rectangle, in screen coordinates, is visible in any screen's
/// working area (the monitor's visible area minus task bars and docked windows)</summary>
/// <param name="rect">Rectangle</param>
/// <returns>Whether the given rectangle is visible</returns>
public static bool IsOnScreen(Rectangle rect)
{
using (Region region = new Region())
{
region.MakeEmpty();
foreach (Screen screen in Screen.AllScreens)
region.Union(screen.WorkingArea);
rect.Inflate(-Margin, -Margin);
return region.IsVisible(rect);
}
}