private void Sel_FormClosing(object sender, FormClosingEventArgs e) { if (select.SelectedArea) { lastFormLocation = select.Location; var offsetLocation = new Point(select.Location.X + 7, select.Location.Y + select.TitleHeight); selectionRectangle = new Rectangle(offsetLocation, select.Size); } select = null; }
private void btnSelect_Click(object sender, EventArgs e) { if (select == null) { select = new RectangleSelect(); if (selectionRectangle != null) { //select.Location = lastFormLocation; } select.FormClosing += Sel_FormClosing; select.Show(); } }