You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SCJMapper-V2/Common/Commons.cs

37 lines
752 B
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SCJMapper_V2.Common
{
/// <summary>
/// Very common static methods etc.
/// </summary>
class Commons
{
/// <summary>
/// Checks if a rectangle is visible on any screen
/// </summary>
/// <param name="formRect"></param>
/// <returns>True if visible</returns>
public static bool IsOnScreen( Rectangle formRect )
{
Screen[] screens = Screen.AllScreens;
foreach ( Screen screen in screens ) {
if ( screen.WorkingArea.Contains( formRect ) ) {
return true;
}
}
return false;
}
}
}