Designing forms for 120DPI, 133DPI etc

J

JezB

I have a windows form app that runs perfectly on a standard 96DPI screen. If
I increase this to 120DPI, suddenly things go wrong: text overflows,things
no longer fit in their containers causing scroll-bars to appear (eg. on
panels), weird things start happening with GDI+ painting, etc.

Is there a simple way I can ensure that a form runs with various DPI
settings?

Failing that, is there a way (in C#) I can test for the DPI setting so that
I can take programattic action to display things differently ?
 
K

Ken Halter

JezB said:
I have a windows form app that runs perfectly on a standard 96DPI screen.
If I increase this to 120DPI, suddenly things go wrong: text
overflows,things no longer fit in their containers causing scroll-bars to
appear (eg. on panels), weird things start happening with GDI+ painting,
etc.

Is there a simple way I can ensure that a form runs with various DPI
settings?

Failing that, is there a way (in C#) I can test for the DPI setting so
that I can take programattic action to display things differently ?

fwiw, no help really... just mentioning that VB6 has a Screen.TwipsPerPixelX
and Y method that returns the number of twips per pixel on a screen. Small
Fonts (96 dpi) always returns 15, Large Fonts (can't recall DPI, hate 'um)
returns 12, Custom settings return, well... custom sizes. The framework must
have something similar.

I was hoping (along with millions of other devs) that the DPI issues would
be long gone by now.... it makes me crazy to see someone buy a huge monitor
and killer gfx card just to turn around and set up Large Fonts or something
equally silly.

(why) Large Font Drivers Suck
http://www.divsoft.com/lfs/
 
J

JezB

Setting AutoScaleMode to DPI for my forms seems to scale everything up so
that it can accommodate the increased font size, BUT embedded images no
longer fit, they appear too small! Argghh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top