From b32f026d348e7b2378c5a65c2872fd95435db28c Mon Sep 17 00:00:00 2001 From: CreateAndInject Date: Tue, 17 Dec 2024 20:06:53 +0800 Subject: [PATCH] Fix Mnemonic --- ILSpy/Controls/CustomDialog.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ILSpy/Controls/CustomDialog.cs b/ILSpy/Controls/CustomDialog.cs index d51f69c0ff..63ca6bef9d 100644 --- a/ILSpy/Controls/CustomDialog.cs +++ b/ILSpy/Controls/CustomDialog.cs @@ -51,8 +51,8 @@ public CustomDialog(string caption, string message, int acceptButton, int cancel using (Graphics g = this.CreateGraphics()) { - SizeF size = TextRenderer.MeasureText(message, label.Font); - Size clientSize = new Size((int)(size.Width * 96 / g.DpiX) + DockPadding.Left + DockPadding.Right, (int)(size.Height * 96 / g.DpiY) + DockPadding.Top + DockPadding.Bottom); + SizeF size = TextRenderer.MeasureText(message, label.Font, default, TextFormatFlags.NoPrefix); + Size clientSize = new Size((int)Math.Ceiling(size.Width * 96 / g.DpiX) + DockPadding.Left + DockPadding.Right, (int)Math.Ceiling(size.Height * 96 / g.DpiY) + DockPadding.Top + DockPadding.Bottom); Button[] buttons = new Button[buttonLabels.Length]; int[] positions = new int[buttonLabels.Length]; int pos = 0; @@ -86,7 +86,7 @@ public CustomDialog(string caption, string message, int acceptButton, int cancel { clientSize.Width = pos; } - clientSize.Height += panel.Height + 6; + clientSize.Height += panel.Height; this.ClientSize = clientSize; int start = (clientSize.Width - pos) / 2; for (int i = 0; i < buttons.Length; i++)