none
How to get the screen resolution in wpf

    Question

  • Hello everyone,

                       I am developing an client/sever application using wpf and wcf, in which when i run the client application on different screen resolution, then the controls(i.e. the size) added in the xbap page changes. So i want to get  the current screen resolution and make the size of controls unchangable.Can anyone help me out.

    Friday, September 01, 2006 12:38 PM

Answers

  •     There is two properties you can look into:
    System.Windows.SystemParameters.PrimaryScreenWidth;
    System.Windows.SystemParameters.PrimaryScreenHeight;

    Sheva
    Saturday, September 02, 2006 6:41 PM
  • look at systemparameters... you can find a lot of useful info there...
    Sunday, September 03, 2006 1:48 AM
    Moderator
  • the size you see on screen would change because you are changing the screen resolution. However, querying the control size should return the same value as before
    Tuesday, May 15, 2007 3:46 PM
    Moderator

All replies

  • The Windows Presentation Foundation ("Avalon") forum seems a better place for this question to get an answer, moving from Visual C# General.
    Saturday, September 02, 2006 3:29 PM
    Moderator
  •     There is two properties you can look into:
    System.Windows.SystemParameters.PrimaryScreenWidth;
    System.Windows.SystemParameters.PrimaryScreenHeight;

    Sheva
    Saturday, September 02, 2006 6:41 PM
  • look at systemparameters... you can find a lot of useful info there...
    Sunday, September 03, 2006 1:48 AM
    Moderator
  • Thanks lester and footballism. It worked.

     

    Wednesday, September 13, 2006 5:02 AM
  • hi shah,

     

     I have same problem.  When i change screen resolution of system , my application controls size get increased .

     

    how can i solve this problem ? Hope for any  reply.

     

     

    Tuesday, May 15, 2007 12:17 PM
  • the size you see on screen would change because you are changing the screen resolution. However, querying the control size should return the same value as before
    Tuesday, May 15, 2007 3:46 PM
    Moderator
  • Hi,

     

      I have set Page height and width in XAML Page. . But when i change screen resolution this height and width get changed.

     

    What should i do to resolve this query?

    Wednesday, May 16, 2007 4:28 AM
  • I used:

    System.Windows.SystemParameters.WorkArea.Height;

    System.Windows.SystemParameters.WorkArea.Width

    because this excludes the Taskbar.

    Wednesday, November 16, 2011 4:57 PM
  • Thanks lester and footballism. It worked.
    Thursday, March 15, 2012 7:58 AM