0

Placing UI control leads to different results depending on the operating system. Below image shows an example for Windows 10:

In the case of Windows 7, I have no issues with it.

Xaml code for button and tab control (overlap):

     <Button  Grid.Column="1" Background="Transparent" Margin="0,0,18,0" HorizontalAlignment="Right" Height="30" Width="30"  VerticalAlignment="Center" BorderBrush="Transparent" Click="Settings_Click" Style="{DynamicResource ButtonStyle1}" >
                        <Button.ToolTip >
                            <TextBlock Margin="-7,-5" Padding="7,5" Foreground="White" Text="{Binding Configuration}" TextWrapping="Wrap"></TextBlock>
                        </Button.ToolTip>
                        <Image   Source="/Resources/017.png" ></Image>
                    </Button>
 <ContentControl Content="{Binding Mode=OneWay}" DataContext="{Binding ActiveVM}" Margin="-1,49,1,1" Grid.RowSpan="2"/>
mpx
  • 3,081
  • 2
  • 26
  • 56
Zada laxmi
  • 123
  • 9
  • 3
    My crystal ball says this has nothing to do with the OS and everything to do with the DPI settings. – Cody Gray - on strike Nov 30 '16 at 10:05
  • In newer versions of Windows standard "zoom" value is set to 125% which you can change in settings. This setting can change the look of your UI completely. Editor (designer) uses 100% "zoom" value so it will look differently. ("zoom" is basicaly what @CodyGray written but in settings it's named somethig with the "zoom" word) – mrogal.ski Nov 30 '16 at 10:18

1 Answers1

0

Had the same problem while moving my app from 7 to 10. Have a look at this thread: How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?

    private static extern bool SetProcessDPIAware(); 

is what made my app look "normal" again.

Community
  • 1
  • 1
Mahobo
  • 105
  • 1
  • 16
  • As Hans's answer makes fairly clear, the *right* way to do this is to configure the application's manifest appropriately. You should *only* P/Invoke SetProcessDPIAware() if you cannot change the manifest, such as for an application deployed via ClickOnce. – Cody Gray - on strike Nov 30 '16 at 11:19