Skip to content

Commit b32f026

Browse files
Fix Mnemonic
1 parent 51aac5f commit b32f026

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ILSpy/Controls/CustomDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public CustomDialog(string caption, string message, int acceptButton, int cancel
5151

5252
using (Graphics g = this.CreateGraphics())
5353
{
54-
SizeF size = TextRenderer.MeasureText(message, label.Font);
55-
Size clientSize = new Size((int)(size.Width * 96 / g.DpiX) + DockPadding.Left + DockPadding.Right, (int)(size.Height * 96 / g.DpiY) + DockPadding.Top + DockPadding.Bottom);
54+
SizeF size = TextRenderer.MeasureText(message, label.Font, default, TextFormatFlags.NoPrefix);
55+
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);
5656
Button[] buttons = new Button[buttonLabels.Length];
5757
int[] positions = new int[buttonLabels.Length];
5858
int pos = 0;
@@ -86,7 +86,7 @@ public CustomDialog(string caption, string message, int acceptButton, int cancel
8686
{
8787
clientSize.Width = pos;
8888
}
89-
clientSize.Height += panel.Height + 6;
89+
clientSize.Height += panel.Height;
9090
this.ClientSize = clientSize;
9191
int start = (clientSize.Width - pos) / 2;
9292
for (int i = 0; i < buttons.Length; i++)

0 commit comments

Comments
 (0)