0

The screen resolution of my dev. machine is 1920 x 1080 and I designed the width of main Window of my application to be 1365.

This means all controls have to be seen exactly same as I designed when my application runs in another same resolution(1920 x 1080) computer.

However, as you can see below captured screen, the first rows from 2 DataGrid are seen with height difference which has to be parallel. (There're 2 same shrinked controls but I didn't capture the screenshot.)

I highly appreciate anybody who has insightful idea for this issue.

dev. machine- Windows 10 LTSB 64 bit 8 GB, Visual Studio 2017 Enterprise.

test machine- Windows 10 Home 64 bit 4 GB

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:Green_Pharmacy"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Name="myMainWindow" x:Class="Green_Pharmacy.Green_MainWindow"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" Height="743" Width="1366" mc:Ignorable="d"
    WindowStartupLocation="CenterScreen" Background="#FF7BD34E" Icon="whitecross_icon.ico" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" UseLayoutRounding="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" RenderOptions.BitmapScalingMode="NearestNeighbor" ResizeMode="CanMinimize" Loaded="myMainWindow_Loaded" Closing="myMainWindow_Closing" KeyDown="myMainWindow_KeyDown" Activated="myMainWindow_Activated" Deactivated="myMainWindow_Deactivated" PreviewMouseLeftButtonUp="MyMainWindow_PreviewMouseLeftButtonUp">

    <Grid x:Name="MainGrid" SizeChanged="MainGrid_SizeChanged" ScrollViewer.VerticalScrollBarVisibility="Disabled" UseLayoutRounding="True" Width="1360" Height="701" Margin="0" VerticalAlignment="Top">

    <Grid.LayoutTransform>
        <ScaleTransform x:Name="ApplicationScaleTransform"
                    CenterX="0"
                    CenterY="0"
                    ScaleX="{Binding ElementName=myMainWindow, Path=ScaleValue}"
                    ScaleY="{Binding ElementName=myMainWindow, Path=ScaleValue}" />
    </Grid.LayoutTransform>

        <DataGrid x:Name="dataGrid_CoffeeServedRecords_Latest" HorizontalAlignment="Left" Margin="10,32,0,0" VerticalAlignment="Top" Height="216" Width="330" AutoGenerateColumns="False" CanUserResizeColumns="False" UseLayoutRounding="True" HorizontalScrollBarVisibility="Disabled" IsReadOnly="True" BorderThickness="0" CanUserAddRows="false" EnableRowVirtualization="False" CanUserResizeRows="False" CanUserReorderColumns="False" LoadingRow="dataGrid_MedicinesDispensedRecords_Latest_LoadingRow" MouseEnter="dataGrid_MedicinesDispensedRecords_Latest_MouseEnter" RowHeight="17">

enter image description here

Kay Lee
  • 922
  • 1
  • 12
  • 40
  • Perhaps show some XAML for that part so it's easier to tell what controls or properties may be causing that behavior. Is this happening from the beginning or when the user resizes the app? – Fabulous Feb 07 '19 at 12:02
  • @Fabulous, ok please wait..My application doesn't allow users to re-size at all. And I installed to 100 machines but first time to encounter a issue like this. – Kay Lee Feb 07 '19 at 12:03
  • 2
    Windows 10 has it's own scaling, Try to scale to 100% on the machine where the layout is wrong – Nawed Nabi Zada Feb 07 '19 at 12:17
  • @NawedNabiZada, many thanks for your advice on own scaling of Window 10. How can I scale to 100 %? in video driver setting? or in my application? or in Visual Studio setting? – Kay Lee Feb 07 '19 at 12:21
  • 1
    Righ click on desktop > Display Settings... > Scale and layout (Change the size of text, apps, and other items > 100% – Nawed Nabi Zada Feb 07 '19 at 12:23
  • @NawedNabiZada, Oh, I've found in my dev.machine. I'll test it tomorrow in test machine. If it works, I'll notify you and mark your answer as solution if you post this comment as official answer. Thank you ! – Kay Lee Feb 07 '19 at 12:26
  • @NawedNabiZada, Unfortunately, really, I even re-booted the test machine but failed. the scale value starts from 100 %, 125, 150, 175 and it was 100% and now on same. I also tried to change settings in Intel HD graphic control panel such as Sustaining horizontal, vertical ratio, Sustaining entire screen ratio and some advanced setting in what you suggested..Anyway, thank you so much ! – Kay Lee Feb 08 '19 at 02:05
  • Suprisingly at the next day I tried to change some video driver setting, shrinking problem disappered but many dropshadow effect were missing. And after re-boot again, the dropshadow effects also worked fine. Still I don't know what's happening here but just assume that we bought this notebook only 1 week ago and it's all about video driver setting(update..?)..Now, scaling is 100 % and other options are same before but only advanced option of scaling is turned on differently. – Kay Lee Feb 09 '19 at 14:01

0 Answers0