Donate

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

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.