Search code examples
wpftouchwpf-controls

Touchscreen control size


How do you handle control size on touchscreen, so it is easily used?

I have seen most examples have TextBox Height set to 40 pixels, or buttons 40x40. So, when I make controls this size and use it on my 13" Full HD device. it is OK.

However, I have noticed that lately there are laptops with very high resolution (ex 3200x1800), and small screens (ex 13-14"). How do you handle such scenarios? They usually set text (app) size to 250% in display settings, although this is mandatory.

Do we programmers need to use text (control) scaling as parameter when building UI?


Solution

  • Writing a DPI–aware application is the key to making a UI look consistently good across a wide variety of high-DPI display settings. Applications that are not DPI–aware but are running on a high-DPI display setting can suffer from many visual artifacts, including incorrect scaling of UI elements, clipped text, and blurry images.

    link: Writing DPI-Aware apps