I changed my PC, and I setup all the apps like Visual Studio, DevExpress etc. with the same version as before.
After that I run the application on Visual Studio (the program is a Windows Forms application with C# code), there is a problem with scaling.
Normally I chose Windows state “maximized”, but on my new PC, when I start the software in Visual Studio, the scaling of the Windows and fonts is so small. How can I fix this?
4
I solved my problem with this codes on program.cs
<code>using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Technopat_Sosyal_Test_Program{
internal static class Program{
/// <summary>
/// Uygulamanın ana girdi noktası.
/// </summary>
[STAThread]
static void Main(){
if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } // Windows Vista ve üzeri olduğunda çalışır.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
[DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
}
}
</code>
<code>using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Technopat_Sosyal_Test_Program{
internal static class Program{
/// <summary>
/// Uygulamanın ana girdi noktası.
/// </summary>
[STAThread]
static void Main(){
if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } // Windows Vista ve üzeri olduğunda çalışır.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
[DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
}
}
</code>
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Technopat_Sosyal_Test_Program{
internal static class Program{
/// <summary>
/// Uygulamanın ana girdi noktası.
/// </summary>
[STAThread]
static void Main(){
if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } // Windows Vista ve üzeri olduğunda çalışır.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
[DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
}
}
1