Check If Mouse Coordinate Is Outside The Form Coordinates In Mouseup Event In C#
This snippet will check if mouse coordinate is outside the form coordinates in mouseup event using the object's ClientRectangle property.
private void dgvScriptsTime_MouseUp(object sender, MouseEventArgs e) { if(!this.ClientRectangle.Contains(e.Location)) { FShowGrid showGrid = new FShowGrid("Test", dgvScriptsTime); showGrid.ShowDialog(); } }
Comments
Post a Comment