9

Possible Duplicate:
How do I detect if the user's font (DPI) is set to small, large, or something else?

I'm looking for a way to retrieve the setting as used in the picture below?

Thanks?

enter image description here

Community
  • 1
  • 1
JimDel
  • 4,309
  • 11
  • 54
  • 99
  • 1
    http://nickstips.wordpress.com/2010/11/08/c-programmatically-get-the-current-dpi-setting/ – SLaks Jan 03 '12 at 21:11
  • 2
    As an aside its worth noting that you can respond in case the user changes the setting while you're app is open. See the [MSDN article How to: Respond to Font Scheme Changes in a Windows Forms Application](http://msdn.microsoft.com/en-us/library/ms229594.aspx) – Conrad Frix Jan 03 '12 at 21:16

2 Answers2

2

Check under class SystemFonts. I don't think you need more than the default namespaces for this.

string name = SystemFonts.IconTitleFont.FontFamily.Name;
float size = SystemFonts.IconTitleFont.Size;
jcvegan
  • 3,111
  • 9
  • 43
  • 66
1

I believe this is already answered here:

How to get Windows Display settings?

The IconTitleFont information would just give you the font size whereas you seem to be looking for the magnification level.

Community
  • 1
  • 1
Mike W
  • 1,276
  • 8
  • 10
  • I tried that but had the same results as some of the other users. The results weren't reliable. – JimDel Jan 03 '12 at 21:37