我的开发者的屏幕分辨率。机器的分辨率为1920 x 1080,我将应用程序主窗口的宽度设计为1365。
这意味着当我的应用程序在另一台相同分辨率(1920 x 1080)的计算机上运行时,所有控件的外观必须与我设计的完全相同。
但是,正如您在捕获的屏幕下方看到的那样,看到2个DataGrid的第一行的高度差必须平行。 (有2个相同的缩小控件,但我没有捕获屏幕截图。)
非常感谢任何对此问题有深刻见解的人。
dev。计算机-Windows 10 LTSB 64位8 GB,Visual Studio 2017 Enterprise。
测试机-Windows 10家庭版64位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">