Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.78 KB

README.md

File metadata and controls

46 lines (39 loc) · 1.78 KB

Dpi Awareness Library

A library for enabling DPI awareness in a Windows Forms application.

Downloads

Usage

  1. Download the Dpi Awareness library.
  2. Extract to any location.
  3. Add libDpi.dll to your project's references.

se

  1. Set the AutoScaleMode of the Forms used in your project to Dpi.

pw

  1. Add the following code to the Program.cs file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms; // <-- Necessary

namespace ExampleApp
{
    internal static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            DpiAwareness.Enable(); // <-- Enable DPI Awareness

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ExampleForm());
        }
    }
}