Fix ListBox overflow on high DPI

This commit is contained in:
剧毒的KCN
2024-09-07 21:16:33 +08:00
parent b37016a49c
commit 5b370ca376
17 changed files with 58 additions and 10 deletions

View File

@@ -63,6 +63,7 @@ namespace GrasscutterTools.Forms
this.ListPages.FormattingEnabled = true;
this.ListPages.Name = "ListPages";
this.ListPages.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListPages_DrawItem);
this.ListPages.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.ListPages_MeasureItem);
this.ListPages.SelectedIndexChanged += new System.EventHandler(this.ListPages_SelectedIndexChanged);
this.ListPages.SizeChanged += new System.EventHandler(this.ListPages_SizeChanged);
//
@@ -116,6 +117,7 @@ namespace GrasscutterTools.Forms
//
// MenuSpawnEntityFilter
//
this.MenuSpawnEntityFilter.ImageScalingSize = new System.Drawing.Size(24, 24);
this.MenuSpawnEntityFilter.Name = "MenuSpawnEntityFilter";
resources.ApplyResources(this.MenuSpawnEntityFilter, "MenuSpawnEntityFilter");
//

View File

@@ -811,5 +811,10 @@ namespace GrasscutterTools.Forms
{
CmbCommand.Text = "";
}
private void ListPages_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListPages.Font.Height * 3 / 2;
}
}
}