font size change in wpf RRS feed

  • Question

  • hi

    when i change my system parameters to 1024 * 768 to some higher parameters ,my wpf app controls font size  changes

    is there any way to change the font size of controls with respect to the screen parameters programatically

    Efforts may fail but don't fail to take effort -------------- sidd

    Thursday, October 25, 2012 2:57 PM

All replies

  • What you are seeing has to do with changes in the resolution.  If you notice, everything else also seemed to become smaller on the screen.  It has to do with everything being drawn to scale instead of to some set size.  You can use an EventHandler for the Microsoft.Win32.SystemEvents.DisplaySettingsChanged event to determine when the resolutino is changed.  I don't know how to determine exactly what the settings are, however, and that only fires if the user changes the resolution AFTER your application is loaded.  I had a similar situation, but it had to do with the size of a grid within my WPF page.  In my case, I was just trying to get something to fit on the very low resolution screen, so I just took the width of the WPF window and adjusted accordingly if the size were too small.  In your case, you might need to determine what size font works best with different resolutions. 

    Hope that helps!

    Christine A. Piffat

    Thursday, October 25, 2012 3:38 PM