#110, #111, version 0.11.1.1

[BUG] ArgumentOutOfRangeException #110
[BUG] AutosizeRows when high dpi #111
This commit is contained in:
Markus Hofknecht 2020-06-22 21:52:35 +02:00
parent fe02510cf6
commit 65159276d7
2 changed files with 18 additions and 12 deletions

View file

@ -88,6 +88,8 @@ namespace SystemTrayMenu.Handler
}
internal void EnterOpensInstantly(DataGridView dgv, int rowIndex)
{
if (dgv.Rows.Count > rowIndex)
{
timerStartLoad.Stop();
StopLoadMenu.Invoke();
@ -96,6 +98,7 @@ namespace SystemTrayMenu.Handler
checkForMouseActive = false;
CallOpenMenuNow();
}
}
internal void MouseMove(object sender, MouseEventArgs e)
{

View file

@ -37,7 +37,6 @@ namespace SystemTrayMenu.UserInterface
private readonly Fading fading = new Fading();
private bool isShowing = false;
private bool dgvAutoResizeRowDone = false;
internal Menu()
{
@ -242,10 +241,14 @@ namespace SystemTrayMenu.UserInterface
internal void AdjustSizeAndLocation(Menu menuPredecessor = null,
bool directionToRight = false)
{
if (!dgvAutoResizeRowDone)
CheckForAutoResizeRowDone();
void CheckForAutoResizeRowDone()
{
if (!(bool)dgv.Tag)
{
dgv.AutoResizeRows();
dgvAutoResizeRowDone = true;
dgv.Tag = true;
}
}
int dgvHeightNeeded = dgv.Rows.GetRowsHeight(