Reputation: 1525
I've created an WPF application that should run on Win7 and Win10. It displays some ListBoxes and I designed it on Win7 - all looks well! Now I run it on Win10 and it looks very wiered. The ListBoxItems are larger than the ones on Win7 and so they display scrollbars where no scrollbar should be.
After some testing with snoop I see that the Border and the Padding of the ListBoxItem has changed.
In Win7: Border="0,0,0,0" Padding="2,0,0,0"
In Win10: Border="1,1,1,1" Padding="4,1,4,1"
Were does this come from?
How can I prevent such errors? It couldn't be that I must set all values of all WPF Elements to an explicit default value, just to be sure they stay the same under Win10.
Upvotes: 0
Views: 82
Reputation: 106
I'm thinking this could be something to do with the Frameworks used, I tested below with Framework 3.5 and Framework 4.6.2. Is this the padding difference you are seeing from Windows 7 to Windows 10?
I checked using snoop and see the padding differences you mentioned, padding="2,0,0,0" changed to "4,1,4,1" Maybe you could set the properties of your application to only use a lower Target Framework that is in your Windows 7 machine?
How to change Target Frameworks: https://msdn.microsoft.com/en-us/library/bb398202.aspx
Upvotes: 0