public ScreenRegionForm(Rectangle regionRectangle, bool activateWindow = true)
{
InitializeComponent();
this.activateWindow = activateWindow;
borderRectangle = regionRectangle.Offset(1);
borderRectangle0Based = new Rectangle(0, 0, borderRectangle.Width, borderRectangle.Height);
Location = borderRectangle.Location;
int windowWidth = Math.Max(borderRectangle.Width, pInfo.Width);
Size = new Size(windowWidth, borderRectangle.Height + pInfo.Height + 1);
pInfo.Location = new Point(0, borderRectangle.Height + 1);
Region region = new Region(ClientRectangle);
region.Exclude(borderRectangle0Based.Offset(-1));
region.Exclude(new Rectangle(0, borderRectangle.Height, windowWidth, 1));
if (borderRectangle.Width < pInfo.Width)
{
region.Exclude(new Rectangle(borderRectangle.Width, 0, pInfo.Width - borderRectangle.Width, borderRectangle.Height));
}
else if (borderRectangle.Width > pInfo.Width)
{
region.Exclude(new Rectangle(pInfo.Width, borderRectangle.Height + 1, borderRectangle.Width - pInfo.Width, pInfo.Height));
}
Region = region;
Timer = new Stopwatch();
}