首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

WPF:哪位高手来运行一下这个代码,发现了一个奇怪现象

2012-03-23 
WPF:谁来运行一下这个代码,发现了一个奇怪现象。为什么Border和Label,这两个控件,没有对齐?而是位置错开了

WPF:谁来运行一下这个代码,发现了一个奇怪现象。
为什么Border和Label,这两个控件,没有对齐?而是位置错开了一个像素?

为什么 Border的大小是21*20?本来应该是20*20。

XML code
<Window x:Class="Test.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        Title="MainWindow" Height="350" Width="525">    <Grid>        <Grid.RowDefinitions>            <RowDefinition Height="Auto"></RowDefinition>            <RowDefinition Height="Auto"></RowDefinition>            <RowDefinition></RowDefinition>        </Grid.RowDefinitions>                <Border Grid.Row="1" Width="20" Height="20" Background="Green" BorderBrush="Transparent"></Border>        <Label  Grid.Row="2"  Width="20" Height="20" Background="Green"></Label>    </Grid>    </Window>


[解决办法]
探讨

如何解决是好?

引用:

发现了这种情况

热点排行