Fixed weird DPI issues

This commit is contained in:
Matt Neumann 2025-03-05 18:09:29 -08:00
parent 76e4491039
commit 8082b4cfc0
4 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,8 @@
<RootNamespace>Better_NCP_Editor</RootNamespace>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<ApplicationHighDpiMode>DpiUnawareGdiScaled</ApplicationHighDpiMode>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

View File

@ -15,7 +15,8 @@ namespace Better_NCP_Editor
{
// Set the minimum and default size.
this.MinimumSize = new Size(210, 120);
//this.AutoScaleDimensions = new SizeF(96F, 96F); // or your base DPI
this.AutoScaleMode = AutoScaleMode.Dpi;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;

View File

@ -26,6 +26,7 @@ namespace Better_NCP_Editor
public Form1()
{
InitializeComponent();
this.AutoScaleMode = AutoScaleMode.None;
dirTreeView.AfterSelect += DirTreeView_AfterSelect;
entityTreeView.NodeMouseDoubleClick += entityTreeView_NodeMouseDoubleClick;
entityTreeView.AfterSelect += entityTreeView_AfterSelect;
@ -66,6 +67,7 @@ namespace Better_NCP_Editor
}
private List<String> LoadItemList(String filepath)
{
try

View File

@ -11,6 +11,9 @@ namespace Better_NCP_Editor
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}