Skip to content

korayustundag/DpiAwareness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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());
        }
    }
}