mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-16 02:13:39 +12:00
[BUG] ArgumentOutOfRangeException since version 1.2.3.6 (#322), version 1.2.6.1
This commit is contained in:
parent
021d1b2d85
commit
37355bdfe1
|
@ -1096,7 +1096,7 @@ namespace SystemTrayMenu.Business
|
|||
{
|
||||
RowData rowData = (RowData)dgv.Rows[hitTestInfo.RowIndex].Cells[2].Value;
|
||||
rowData.MouseDown(dgv, e);
|
||||
dgv.InvalidateRow(hitTestInfo.RowIndex);
|
||||
InvalidateRowIfIndexInRange(dgv, hitTestInfo.RowIndex);
|
||||
}
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
|
@ -1181,7 +1181,7 @@ namespace SystemTrayMenu.Business
|
|||
{
|
||||
RowData trigger = (RowData)dgv.Rows[hitTestInfo.RowIndex].Cells[2].Value;
|
||||
trigger.DoubleClick(e, out bool toCloseByDoubleClick);
|
||||
dgv.InvalidateRow(hitTestInfo.RowIndex);
|
||||
InvalidateRowIfIndexInRange(dgv, hitTestInfo.RowIndex);
|
||||
if (toCloseByDoubleClick)
|
||||
{
|
||||
MenusFadeOut();
|
||||
|
@ -1191,6 +1191,14 @@ namespace SystemTrayMenu.Business
|
|||
lastMouseDownRowIndex = -1;
|
||||
}
|
||||
|
||||
private void InvalidateRowIfIndexInRange(DataGridView dgv, int rowIndex)
|
||||
{
|
||||
if (rowIndex > -1 && rowIndex < dgv.Rows.Count)
|
||||
{
|
||||
dgv.InvalidateRow(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void Dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
RefreshSelection((DataGridView)sender);
|
||||
|
|
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.6.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.6.0")]
|
||||
[assembly: AssemblyVersion("1.2.6.1")]
|
||||
[assembly: AssemblyFileVersion("1.2.6.1")]
|
||||
|
|
Loading…
Reference in a new issue