mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Fix scaling of listview columns
https://stackoverflow.com/questions/10795134/c-sharp-listview-column-text-size-is-not-the-same-on-each-computer/36974138#36974138
This commit is contained in:
parent
a8892d1503
commit
67495fc952
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,7 @@ namespace ShareX.HelpersLib
|
|||
public class MyListView : ListView
|
||||
{
|
||||
public delegate void ListViewItemMovedEventHandler(object sender, int oldIndex, int newIndex);
|
||||
|
||||
public event ListViewItemMovedEventHandler ItemMoved;
|
||||
|
||||
[DefaultValue(false)]
|
||||
|
@ -330,5 +331,14 @@ private void DrawInsertionLine(int left, int right, int y)
|
|||
g.FillPolygon(SystemBrushes.HotTrack, rightTriangle);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
|
||||
{
|
||||
base.ScaleControl(factor, specified);
|
||||
foreach (ColumnHeader column in Columns)
|
||||
{
|
||||
column.Width = (int)Math.Round(column.Width * factor.Width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue