mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-02 02:24:38 +12:00
[BUG] AutosizeRows when high dpi (#111), version 0.11.2.4
This commit is contained in:
parent
2bfc3d40d3
commit
c4adc8c0d8
|
@ -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")]
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue