diff --git a/CLAUDE.md b/CLAUDE.md
index cac1c5b..2f7cdd5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -18,10 +18,10 @@ Since the solution targets both .NET Framework 4.8 and .NET Core, use MSBuild in
"P:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" InfoBox.sln
# Build with specific configuration
-"P:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" InfoBox.sln /p:Configuration=Release
+"P:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" InfoBox.sln -p:Configuration=Release
# Rebuild all (clean + build)
-"P:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" InfoBox.sln /t:Rebuild
+"P:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" InfoBox.sln -t:Rebuild
# Run tests
dotnet test
diff --git a/InfoBox.Designer/InfoBox.Designer.csproj b/InfoBox.Designer/InfoBox.Designer.csproj
index fb760ad..b3dabf2 100644
--- a/InfoBox.Designer/InfoBox.Designer.csproj
+++ b/InfoBox.Designer/InfoBox.Designer.csproj
@@ -80,6 +80,7 @@
+
diff --git a/InfoBox.Designer/InformationBoxDesigner.Designer.cs b/InfoBox.Designer/InformationBoxDesigner.Designer.cs
index f5a6efd..180d03e 100644
--- a/InfoBox.Designer/InformationBoxDesigner.Designer.cs
+++ b/InfoBox.Designer/InformationBoxDesigner.Designer.cs
@@ -32,6 +32,7 @@ private void InitializeComponent()
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InformationBoxDesigner));
groupBox1 = new System.Windows.Forms.GroupBox();
btnEditText = new System.Windows.Forms.Button();
+ btnLoremIpsum = new System.Windows.Forms.Button();
txbText = new System.Windows.Forms.TextBox();
txbTitle = new System.Windows.Forms.TextBox();
label2 = new System.Windows.Forms.Label();
@@ -181,6 +182,7 @@ private void InitializeComponent()
//
// groupBox1
//
+ groupBox1.Controls.Add(btnLoremIpsum);
groupBox1.Controls.Add(btnEditText);
groupBox1.Controls.Add(txbText);
groupBox1.Controls.Add(txbTitle);
@@ -206,6 +208,17 @@ private void InitializeComponent()
btnEditText.UseVisualStyleBackColor = true;
btnEditText.Click += BtnEditText_Click;
//
+ // btnLoremIpsum
+ //
+ btnLoremIpsum.Location = new System.Drawing.Point(258, 90);
+ btnLoremIpsum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ btnLoremIpsum.Name = "btnLoremIpsum";
+ btnLoremIpsum.Size = new System.Drawing.Size(29, 25);
+ btnLoremIpsum.TabIndex = 4;
+ btnLoremIpsum.Image = new System.Drawing.Bitmap(System.Drawing.SystemIcons.Question.ToBitmap(), new System.Drawing.Size(16, 16));
+ btnLoremIpsum.UseVisualStyleBackColor = true;
+ btnLoremIpsum.Click += BtnLoremIpsum_Click;
+ //
// txbText
//
txbText.Location = new System.Drawing.Point(59, 61);
@@ -1543,8 +1556,8 @@ private void InitializeComponent()
//
// InformationBoxDesigner
//
- AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(966, 790);
Controls.Add(groupBox22);
Controls.Add(groupBox21);
@@ -1752,5 +1765,6 @@ private void InitializeComponent()
private System.Windows.Forms.RadioButton rdbAutoSizeFitToText;
private System.Windows.Forms.Label lblFontColor;
private System.Windows.Forms.Button btnEditText;
+ private System.Windows.Forms.Button btnLoremIpsum;
}
}
\ No newline at end of file
diff --git a/InfoBox.Designer/InformationBoxDesigner.cs b/InfoBox.Designer/InformationBoxDesigner.cs
index 5ecfe04..99bfd53 100644
--- a/InfoBox.Designer/InformationBoxDesigner.cs
+++ b/InfoBox.Designer/InformationBoxDesigner.cs
@@ -10,6 +10,7 @@ namespace InfoBox.Designer
using System;
using System.Drawing;
using System.Globalization;
+ using System.Net.Http;
using System.Threading;
using System.Windows.Forms;
@@ -896,6 +897,33 @@ private void BtnEditText_Click(object sender, EventArgs e)
this.textEditorForm.BringToFront();
}
+ ///
+ /// Handles the Click event of the btnLoremIpsum control.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ private async void BtnLoremIpsum_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ this.btnLoremIpsum.Enabled = false;
+ using (var client = new HttpClient())
+ {
+ string text = await client.GetStringAsync("https://lorem-api.com/api/lorem?paragraphs=10&seed=InfoBox");
+ this.txbText.Text = text;
+ this.txbTitle.Text = "Lorem Ipsum";
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Failed to fetch Lorem Ipsum text: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ finally
+ {
+ this.btnLoremIpsum.Enabled = true;
+ }
+ }
+
#endregion Event handlers
}
}
\ No newline at end of file
diff --git a/InfoBox.Designer/Program.cs b/InfoBox.Designer/Program.cs
index 66b09ab..669f377 100644
--- a/InfoBox.Designer/Program.cs
+++ b/InfoBox.Designer/Program.cs
@@ -8,7 +8,7 @@ namespace InfoBox.Designer
{
using System;
using System.Windows.Forms;
-
+
///
/// Entry point for the designer
///
@@ -20,6 +20,9 @@ public static class Program
[STAThread]
public static void Main()
{
+#if NET5_0_OR_GREATER
+ Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
+#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new InformationBoxDesigner());
diff --git a/InfoBox.Designer/TextEditorForm.Designer.cs b/InfoBox.Designer/TextEditorForm.Designer.cs
index 3bbc762..7b933ee 100644
--- a/InfoBox.Designer/TextEditorForm.Designer.cs
+++ b/InfoBox.Designer/TextEditorForm.Designer.cs
@@ -45,8 +45,8 @@ private void InitializeComponent()
//
// TextEditorForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(501, 344);
this.Controls.Add(this.txtContent);
this.MinimizeBox = false;
diff --git a/InfoBox.Designer/TextEditorForm.cs b/InfoBox.Designer/TextEditorForm.cs
index 60e4019..93ed6a4 100644
--- a/InfoBox.Designer/TextEditorForm.cs
+++ b/InfoBox.Designer/TextEditorForm.cs
@@ -18,6 +18,13 @@ public partial class TextEditorForm : Form
private readonly InformationBoxDesigner parentDesigner;
private bool isUpdating = false;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ private TextEditorForm()
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
diff --git a/InfoBox/Form/InformationBoxForm.Designer.cs b/InfoBox/Form/InformationBoxForm.Designer.cs
index d8e3968..0878f01 100644
--- a/InfoBox/Form/InformationBoxForm.Designer.cs
+++ b/InfoBox/Form/InformationBoxForm.Designer.cs
@@ -131,7 +131,6 @@ private void InitializeComponent()
//
// pnlScrollText
//
- this.pnlScrollText.AutoScroll = true;
this.pnlScrollText.Controls.Add(this.messageText);
this.pnlScrollText.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlScrollText.Location = new System.Drawing.Point(79, 0);
@@ -188,8 +187,8 @@ private void InitializeComponent()
//
// InformationBoxForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(257, 153);
this.Controls.Add(this.pnlForm);
this.DoubleBuffered = true;
diff --git a/InfoBox/Form/InformationBoxForm.cs b/InfoBox/Form/InformationBoxForm.cs
index 301a380..fcb86b3 100644
--- a/InfoBox/Form/InformationBoxForm.cs
+++ b/InfoBox/Form/InformationBoxForm.cs
@@ -39,6 +39,11 @@ internal partial class InformationBoxForm : Form
#region Attributes
+ ///
+ /// DPI scale factor relative to 96 DPI
+ ///
+ private float dpiScale;
+
///
/// Contains the callback used to inform the caller of a modeless box
///
@@ -208,6 +213,12 @@ internal partial class InformationBoxForm : Form
#region Constructors
+ ///
+ /// Initializes a new instance of the .
+ ///
+ private InformationBoxForm()
+ {
+ }
///
/// Initializes a new instance of the class using the specified text.
@@ -278,6 +289,7 @@ internal InformationBoxForm(string text,
InformationBoxSound sound = InformationBoxSound.Default)
{
this.InitializeComponent();
+ this.dpiScale = this.DeviceDpi / 96f;
// Apply default font for message boxes
this.Font = SystemFonts.MessageBoxFont;
@@ -300,7 +312,7 @@ internal InformationBoxForm(string text,
if (customIcon != null)
{
this.iconType = IconType.UserDefined;
- this.customIcon = new Icon(customIcon, 48, 48);
+ this.customIcon = customIcon;
}
this.defaultButton = defaultButton;
if (customButtons != null)
@@ -434,7 +446,7 @@ internal InformationBoxForm(string text, params object[] parameters)
{
// User defined icon
this.iconType = IconType.UserDefined;
- this.customIcon = new Icon((Icon)parameter, 48, 48);
+ this.customIcon = (Icon)parameter;
}
else if (parameter is InformationBoxDefaultButton)
{
@@ -671,6 +683,11 @@ private void PlaySound()
#endregion Sound
+ ///
+ /// Scales a 96-DPI pixel value to the current monitor DPI.
+ ///
+ private int ScaleDpi(int value) => (int)Math.Round(value * this.dpiScale);
+
#region Box initialization
///
@@ -991,26 +1008,27 @@ private void SetLayout()
{
int totalHeight;
int totalWidth;
+ this.pnlScrollText.AutoScroll = false;
#region Width
// Caption width including button
- int captionWidth = TextRenderer.MeasureText(Text, SystemFonts.CaptionFont, Size.Empty, TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix).Width + 30;
+ int captionWidth = TextRenderer.MeasureText(Text, SystemFonts.CaptionFont, Size.Empty, TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix).Width + ScaleDpi(30);
if (this.titleStyle != InformationBoxTitleIconStyle.None)
{
- captionWidth += BorderPadding * 2;
+ captionWidth += ScaleDpi(BorderPadding) * 2;
}
// "Do not show this dialog again" width
int checkBoxWidth = ((this.checkBox & InformationBoxCheckBox.Show) == InformationBoxCheckBox.Show)
- ? TextRenderer.MeasureText(this.chbDoNotShow.Text, this.chbDoNotShow.Font, Size.Empty, TextFormatFlags.NoPadding).Width + BorderPadding * 4
+ ? TextRenderer.MeasureText(this.chbDoNotShow.Text, this.chbDoNotShow.Font, Size.Empty, TextFormatFlags.NoPadding).Width + ScaleDpi(BorderPadding) * 4
: 0;
// Width of the text and icon.
int iconAndTextWidth = 0;
// Minimum width to display all needed buttons.
- int buttonsMinWidth = (this.pnlButtons.Controls.Count + 4) * BorderPadding;
+ int buttonsMinWidth = (this.pnlButtons.Controls.Count + 4) * ScaleDpi(BorderPadding);
foreach (Control ctrl in this.pnlButtons.Controls)
{
buttonsMinWidth += ctrl.Width;
@@ -1019,11 +1037,11 @@ private void SetLayout()
// Icon width
if (this.icon != InformationBoxIcon.None || this.iconType == IconType.UserDefined)
{
- iconAndTextWidth += IconPanelWidth;
+ iconAndTextWidth += ScaleDpi(IconPanelWidth);
}
// Text width
- iconAndTextWidth += this.messageText.Width + BorderPadding * 2;
+ iconAndTextWidth += this.messageText.Width + ScaleDpi(BorderPadding) * 2;
// Gets the maximum size
totalWidth = Math.Max(Math.Max(Math.Max(buttonsMinWidth, iconAndTextWidth), captionWidth), checkBoxWidth);
@@ -1035,7 +1053,6 @@ private void SetLayout()
if ((this.checkBox & InformationBoxCheckBox.Show) != InformationBoxCheckBox.Show)
{
this.chbDoNotShow.Visible = false;
- this.pnlBas.Height -= this.chbDoNotShow.Height;
}
int iconHeight = 0;
@@ -1046,24 +1063,25 @@ private void SetLayout()
int textHeight = this.messageText.Height;
- totalHeight = Math.Max(iconHeight, textHeight) + BorderPadding * 2 + this.pnlBas.Height;
+ totalHeight = Math.Max(iconHeight, textHeight) + ScaleDpi(BorderPadding) * 2 + this.pnlBas.Height;
// Add a small space to avoid vertical scrollbar.
- if (iconAndTextWidth > Screen.PrimaryScreen.WorkingArea.Width - 100)
+ if (iconAndTextWidth > Screen.PrimaryScreen.WorkingArea.Width - ScaleDpi(100))
{
- totalHeight += 20;
+ totalHeight += ScaleDpi(20);
}
bool verticalScroll = false;
- if (totalHeight > Screen.PrimaryScreen.WorkingArea.Height - 50)
+ if (totalHeight > Screen.PrimaryScreen.WorkingArea.Height - ScaleDpi(50))
{
- totalHeight = Screen.PrimaryScreen.WorkingArea.Height - 50;
- totalWidth += 20;
- this.messageText.Top = BorderPadding;
+ totalHeight = Screen.PrimaryScreen.WorkingArea.Height - ScaleDpi(50);
+ totalWidth += ScaleDpi(20);
+ this.messageText.Top = ScaleDpi(BorderPadding);
verticalScroll = true;
+ this.pnlScrollText.AutoScroll = true;
}
- this.pnlMain.Size = new Size(Math.Min(Screen.PrimaryScreen.WorkingArea.Width - 20, totalWidth), totalHeight - this.pnlBas.Height);
+ this.pnlMain.Size = new Size(Math.Min(Screen.PrimaryScreen.WorkingArea.Width - ScaleDpi(20), totalWidth), totalHeight - this.pnlBas.Height);
if (this.style == InformationBoxStyle.Modern)
{
@@ -1073,19 +1091,27 @@ private void SetLayout()
#endregion Height
// Sets the size
- ClientSize = new Size(Math.Min(Screen.PrimaryScreen.WorkingArea.Width - 20, totalWidth), totalHeight);
+ ClientSize = new Size(Math.Min(Screen.PrimaryScreen.WorkingArea.Width - ScaleDpi(20), totalWidth), totalHeight);
#region Position
// Set new position for all components
// Icon
- this.pcbIcon.Left = BorderPadding;
- this.pcbIcon.Top = BorderPadding;
+ this.pcbIcon.Left = ScaleDpi(BorderPadding);
+ this.pcbIcon.Top = ScaleDpi(BorderPadding);
// Text
this.pnlScrollText.Width = ClientSize.Width - ((this.icon != InformationBoxIcon.None || this.iconType == IconType.UserDefined)
- ? IconPanelWidth + BorderPadding + 5
- : BorderPadding);
+ ? ScaleDpi(IconPanelWidth) + ScaleDpi(BorderPadding) + ScaleDpi(5)
+ : ScaleDpi(BorderPadding));
+ this.messageText.Left = 0;
+
+ if (this.messageText.Width > this.pnlScrollText.ClientSize.Width)
+ {
+ verticalScroll = true;
+ this.pnlScrollText.AutoScroll = true;
+ }
+
if (!verticalScroll)
{
this.messageText.Top = Convert.ToInt32((this.pnlText.Height - this.messageText.Height) / 2);
@@ -1110,11 +1136,11 @@ private void SetButtonsLayout()
switch (this.buttonsLayout)
{
case InformationBoxButtonsLayout.GroupLeft:
- spaceBetween = BorderPadding;
- initialPosition = BorderPadding;
+ spaceBetween = ScaleDpi(BorderPadding);
+ initialPosition = ScaleDpi(BorderPadding);
break;
case InformationBoxButtonsLayout.GroupMiddle:
- spaceBetween = BorderPadding;
+ spaceBetween = ScaleDpi(BorderPadding);
// If there is only one button then we must center it
if (buttonsCount == 1)
@@ -1123,13 +1149,13 @@ private void SetButtonsLayout()
}
else
{
- initialPosition = Convert.ToInt32((this.pnlButtons.ClientSize.Width - (buttonsCount * (this.pnlButtons.Controls[0].Width + BorderPadding))) / 2);
+ initialPosition = Convert.ToInt32((this.pnlButtons.ClientSize.Width - (buttonsCount * (this.pnlButtons.Controls[0].Width + ScaleDpi(BorderPadding)))) / 2);
}
break;
case InformationBoxButtonsLayout.GroupRight:
- spaceBetween = BorderPadding;
- initialPosition = this.pnlButtons.ClientSize.Width - (buttonsCount * (this.pnlButtons.Controls[0].Width + BorderPadding));
+ spaceBetween = ScaleDpi(BorderPadding);
+ initialPosition = this.pnlButtons.ClientSize.Width - (buttonsCount * (this.pnlButtons.Controls[0].Width + ScaleDpi(BorderPadding)));
break;
case InformationBoxButtonsLayout.Separate:
spaceBetween = Convert.ToInt32((this.pnlButtons.ClientSize.Width - buttonsCount * this.pnlButtons.Controls[0].Width) / (buttonsCount + 1));
@@ -1170,11 +1196,11 @@ private void SetIcon()
}
else
{
- this.pcbIcon.Image = this.customIcon.ToBitmap();
+ this.pcbIcon.Image = new Icon(this.customIcon, ScaleDpi(48), ScaleDpi(48)).ToBitmap();
this.pnlIcon.Visible = true;
}
- this.pnlIcon.Width = IconPanelWidth;
+ this.pnlIcon.Width = ScaleDpi(IconPanelWidth);
if (this.titleStyle == InformationBoxTitleIconStyle.None)
{
@@ -1278,9 +1304,8 @@ private void SetText()
foreach (Match sentence in sentences)
{
- // FIX: In case an icon is configured, the maximum width of the text should be reduced to accomodate the icon width and avoid the horizontal scrollbar.
int sentenceLength = TextRenderer.MeasureText(sentence.Value, this.messageText.Font, Size.Empty, TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding).Width;
- if (currentWidth != 0 && (sentenceLength + currentWidth) > (screenWidth - 50))
+ if (currentWidth != 0 && (sentenceLength + currentWidth + this.pnlIcon.Width) > (screenWidth - ScaleDpi(50)))
{
formattedText.Append(Environment.NewLine);
currentWidth = 0;
@@ -1302,7 +1327,7 @@ private void SetText()
}
}
- this.messageText.Width += BorderPadding;
+ this.messageText.Width += ScaleDpi(BorderPadding);
}
#endregion Text
@@ -1409,15 +1434,15 @@ private void SetButtonsSize()
// Measures the width of each button
foreach (Control ctrl in this.pnlButtons.Controls)
{
- maxSize = Math.Max(TextRenderer.MeasureText(ctrl.Text, ctrl.Font, Size.Empty, TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix).Width + 40, maxSize);
+ maxSize = Math.Max(TextRenderer.MeasureText(ctrl.Text, ctrl.Font, Size.Empty, TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix).Width + ScaleDpi(40), maxSize);
}
foreach (Control ctrl in this.pnlButtons.Controls)
{
if (this.style == InformationBoxStyle.Standard)
{
- ctrl.Size = new Size(maxSize, 23);
- ctrl.Top = 5;
+ ctrl.Size = new Size(maxSize, ScaleDpi(23));
+ ctrl.Top = ScaleDpi(5);
}
else if (this.style == InformationBoxStyle.Modern)
{
@@ -1559,6 +1584,20 @@ private void OpenHelp()
#region Event handling
+ ///
+ /// Handles DPI changes (e.g. moving the form to a monitor with different scaling).
+ ///
+ protected override void OnDpiChanged(DpiChangedEventArgs e)
+ {
+ base.OnDpiChanged(e);
+ this.dpiScale = e.DeviceDpiNew / 96f;
+ this.pnlScrollText.AutoScrollPosition = Point.Empty;
+ this.SetButtonsSize();
+ this.SetText();
+ this.SetIcon();
+ this.SetLayout();
+ }
+
///
/// Handles the Click event of the buttons.
///
diff --git a/InfoBox/InfoBox.nuspec b/InfoBox/InfoBox.nuspec
index c76ae7f..f518e40 100644
--- a/InfoBox/InfoBox.nuspec
+++ b/InfoBox/InfoBox.nuspec
@@ -2,7 +2,7 @@
InformationBox
- 1.4.0
+ 1.5.0
InformationBox
Johann Blais
Johann Blais
@@ -17,9 +17,10 @@ InformationBox is the simplest and easiest way to create personalized MessageBox
Stop wasting time developing your own custom MessageBox, everything you need is already available. Just customize your MessageBox using the visual designer and the code is automatically generated !
InformationBox (.NET 4.8+, dotnet core 8.0+) is a flexible alternative to the default MessageBox included in the System.Windows.Forms namespace
- - Improved text measurement accuracy by migrating from Graphics.MeasureString (GDI+) to TextRenderer.MeasureText (GDI)
- - Removed Graphics dependency for better testability
- - Text sizing now matches actual TextBox rendering more accurately
+ - Fixed button layout issue in High DPI mode
+ - Fixed text layout when an icon is selected, the autosize mode is set to minimum height, and the text is too large
+ - DPI handling improvements
+ - Added Lorem Ipsum button in the Designer to quickly populate text content and title
Copyright 2026
en-US
diff --git a/InfoBox/Properties/AssemblyInfo.cs b/InfoBox/Properties/AssemblyInfo.cs
index 527c397..aca0758 100644
--- a/InfoBox/Properties/AssemblyInfo.cs
+++ b/InfoBox/Properties/AssemblyInfo.cs
@@ -52,5 +52,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.4.0.0")]
-[assembly: AssemblyFileVersion("1.4.0.0")]
+[assembly: AssemblyVersion("1.5.0.0")]
+[assembly: AssemblyFileVersion("1.5.0.0")]
diff --git a/InfoBoxCore.ManualTests/InfoBoxCore.ManualTests.csproj b/InfoBoxCore.ManualTests/InfoBoxCore.ManualTests.csproj
index c09c976..8b2a51b 100644
--- a/InfoBoxCore.ManualTests/InfoBoxCore.ManualTests.csproj
+++ b/InfoBoxCore.ManualTests/InfoBoxCore.ManualTests.csproj
@@ -1,15 +1,16 @@
-
- WinExe
- net10.0-windows
- enable
- true
- enable
-
+
+ WinExe
+ net10.0-windows
+ enable
+ true
+ enable
+ true
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/InfoBoxCore.ManualTests/ManualTestsForm.Designer.cs b/InfoBoxCore.ManualTests/ManualTestsForm.Designer.cs
index 5898d7c..3073ac4 100644
--- a/InfoBoxCore.ManualTests/ManualTestsForm.Designer.cs
+++ b/InfoBoxCore.ManualTests/ManualTestsForm.Designer.cs
@@ -75,9 +75,9 @@ private void InitializeComponent()
btnTestLongLinesFixedFont.Click += btnTestLongLinesFixedFont_Click;
//
// ManualTestsForm
- //
- AutoScaleDimensions = new SizeF(7F, 15F);
- AutoScaleMode = AutoScaleMode.Font;
+ //
+ AutoScaleDimensions = new SizeF(96F, 96F);
+ AutoScaleMode = AutoScaleMode.Dpi;
ClientSize = new Size(800, 450);
Controls.Add(btnTestLongLinesFixedFont);
Controls.Add(btnTestFixedWidthTwelvePoints);
diff --git a/InfoBoxCore.ManualTests/Program.cs b/InfoBoxCore.ManualTests/Program.cs
index a315c61..caa3056 100644
--- a/InfoBoxCore.ManualTests/Program.cs
+++ b/InfoBoxCore.ManualTests/Program.cs
@@ -8,6 +8,9 @@ internal static class Program
[STAThread]
static void Main()
{
+#if NET5_0_OR_GREATER
+ Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
+#endif
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();