c# - WinForms Different DPI Layouts -


Controls and designers created through any form and visual studio to develop themselves on the basis of existing DPI / font size The ability to do a part of my UI of Windows is the tab control full of dynamic pages and labels / inputs prepared on the basis of user selection. When these are made, they use hard coded shapes that look right for 96 dpi.

Is there an automatic path in the net to take these generated controls, for designer-generated control? I would like to avoid control scaling myself because this is the old code which does not keep up easily.

Okay, this tab is technically easy to repeat the control collection and the scaling factor By multiplying points and size properties. But when you start accounting for dock and anchor properties, then it becomes very difficult.

The simplest method so far is that Form Class Scaling Machinery will work for you. You will need to add control to the before tab pages that run the load event. Do this in the constructor.

To avoid the pain of changing the DPI setting to check your code, Quick Tip: Add to your form constructor to open the recirring argument to add it:

  Secure Override Zero Onload (EventAgds E) {this.Font = New Font (font.fontfontsfamily, this.font size * 120/96); Base.OnLoad (E); }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -