[BUG] AutosizeRows when high dpi (#111), version 0.11.2.4

This commit is contained in:
Markus Hofknecht 2020-07-03 20:10:37 +02:00
parent 2bfc3d40d3
commit c4adc8c0d8
2 changed files with 16 additions and 15 deletions

View file

@ -35,5 +35,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("0.11.2.3")]
[assembly: AssemblyFileVersion("0.11.2.3")]
[assembly: AssemblyVersion("0.11.2.4")]
[assembly: AssemblyFileVersion("0.11.2.4")]

View file

@ -250,28 +250,29 @@ namespace SystemTrayMenu.UserInterface
factor = 1.5;
}
if (dgv.Tag == null)
if (menuPredecessor == null)
{
if (menuPredecessor == null)
if (dgv.Tag == null && dgv.Rows.Count > 0)
{
dgv.AutoResizeRows();
if (factor > 1)
dgv.RowTemplate.Height = (int)(dgv.Rows[0].Height * factor);
foreach (DataGridViewRow row in dgv.Rows)
{
dgv.RowTemplate.Height = (int)(dgv.RowTemplate.Height * factor);
foreach (DataGridViewRow row in dgv.Rows)
{
row.Height = dgv.RowTemplate.Height;
}
row.Height = dgv.RowTemplate.Height;
}
dgv.Tag = true;
}
else
}
else
{
dgv.RowTemplate.Height = menuPredecessor.GetDataGridView().
RowTemplate.Height;
foreach (DataGridViewRow row in dgv.Rows)
{
dgv.RowTemplate.Height = menuPredecessor.GetDataGridView().
RowTemplate.Height;
dgv.Tag = true;
row.Height = dgv.RowTemplate.Height;
}
}
dgv.Tag = true;
}
}
int dgvHeightNeeded = dgv.Rows.GetRowsHeight(