Windows applications: User interface controls too small on high DPI displays

The problem: Controls are too small

You’re running an application on a PC with a high DPI display and some (or all) of the controls are too small. You do not want to change the system-wide scaling settings just to make this application more usable.

The solution: Change the app’s high DPI setting

Windows 10 allows you to change the high DPI settings for each application.

  1. Open the application.
  2. Right-click on the app icon in the taskbar.
  3. Right-click on the app’s name.
  4. Select Properties:
Opening app properties window from the taskbar

If this method does not work, locate the application’s folder and right-click on the application file (.exe), then select Properties.

  1. Select the Compatibility tab.
  2. Click on Change high DPI settings:
Change high DPI settings
  1. Check the Override high DPI scaling behavior checkbox and select a new setting from the drop-down list:
High DPI setting
  1. Confirm both open dialogs with OK.

System” should solve the issue of some controls being smaller than others), though the app will look a bit blurry. “System (enhanced)” will try to make everything look more crisp. You might want to try out all settings (and you may have to restart the app to see any changes).

You can find further information on the settings in this Windows Blog article under “End-user DPI-scaling improvements”.

Finding exported templates in Visual Studio 2019

The problem: Exported project templates do not appear in the “new project” dialog

You’ve exported a project as a template. You’ve made sure that “automatically import the template into Visual studio” was checked:

Still, the template does not appear in the “new project” dialog.

Possible solution

Make sure you’ve not made any selection in the “language”, “platform” or “project type” dropdowns:

After clearing the C# language selection, the export template appears:

In Visual Studio 16.1.4, it was also not possible to enter the name of the template:

However, this seems to have been fixed (works in 16.4.1).

DeepL translator now available as desktop app

DeepL.com is currently the best AI translator* and is now available as an app for Windows and macOS. This means that users will no longer have to copy text back and forth between their application and the DeepL website:

DeepL for Windows welcome screen

Just like the website, the app is able to provide alternatives to the suggested translations and adapts the rest of the sentence, if necessary:

DeepL app for windows screenshot

The limit of 5000 characters per translation can be lifted by signing up for a DeepL Pro plan.

Wondering why the download for Windows has an impressive size of 135 MB? This is mainly due to the use of the Chromium Embedded Framework, which is included both in a 32 bit and 64 bit version.

*Is the Deepl.com the best AI translator? I think so. Like everything on this blog, this is just my opinion. However, as someone living and working in Luxembourg, a country with three official languages, I sure appreciate DeepL.com a lot.

Alternative apps

QTranslate has been around for several years, is also available for free and integrates several different translation services (including DeepL):

QTranslate screenshot

It has additional features like image text recognition, text to speech synthesis and searching in online and offline dictionaries. However, it seems that it can only provide alternative translations for single words. The size of the download is less than 1 MB.

Reading the version from a ClickOnce .application file

ClickOnce .application files contain an assemblyIdentity element with a version attribute:

<?xml version="1.0" encoding="utf-8"?>
...
  <assemblyIdentity name="Simple Data Logger.application" version="1.1.2.1" publicKeyToken="0c3a74e9157b5601" language="en" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

An easy way to read this version string is:

var assembly = XElement.Load(uri);
XNamespace ns = "urn:schemas-microsoft-com:asm.v1";
remoteVersionString = assembly.Element(ns + "assemblyIdentity").Attribute("version").Value;

You can use this to create a Version object:

var version = new Version(remoteVersionString);

Note: The code above runs synchronously and blocks your application. To avoid this, you could run it in as a task on the thread pool with Task.Run() or you could use XElement.LoadAsync instead of XElement.Load(), if available.