Question

I have WPF application work with 1024x768 screen resolution, now I want to run this application on Microsoft Surface with wide resolution, I had make new windows with resolution 1366x768, but unfortunately I can't make it work fine on Surface, I tested it on my laptop, it's work 100%, but I don't understand why it would't work in the same way on Surface.

If there is anyone that has experience with Surface can you please help?

Update

When I run the WPF windows with resolution 1920x1080 work full screen on my laptop, but the problem is when run application on Surface with the same resolution don't fit the full screen, see this screenshot to more clarity:

enter image description here

Was it helpful?

Solution

Maybe your surface and laptop have different DPI settings. See here how to handle that problem.

OTHER TIPS

From the information provided it may be that your WPF window layout doesn't sufficiently take into account differences in Display text and item sizing on different devices.

On both your Surface Pro and your laptop:

  1. Select "Screen Resolution" from the Desktop context menu.
  2. Select "Make text and other items larger or smaller" from the Screen Resolution window.
  3. Check the position of the "Change the size of all items" slider.

By default the Surface Pro is set to Larger. A new Windows 8 install will be set to Smaller.

In WPF you should not be setting a constant window size, instead you should:

  1. Make the window's content react to the window size by using auto sizes and grids instead of constant sizes and panels

  2. You can use WindowState="Maximized" to make the window full screen

You can prevent your window from being reduced too much with minwidth and minheight.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top