在WPF网格中删除行之间的线

时间:2019-05-17 21:04:54

标签: wpf

我在WPF应用程序中具有以下XAML。行之间有白色水平线。有什么办法可以删除它们?

    <Grid>
    <Grid.RowDefinitions>
        <RowDefinition x:Name="Header" Height="Auto"/>
        <RowDefinition x:Name="Body" Height="1*"/>
        <RowDefinition x:Name="Footer" Height=".5*"/>
    </Grid.RowDefinitions>

    <Grid Grid.Row="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".4*"/>
                <ColumnDefinition />
                <ColumnDefinition Width=".4*"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Column="1" Background="#454d52"/>
            <TextBlock Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="54" Text="" Padding="200,30,200,30"/>
        </Grid>
        <Grid Grid.Row="1">
            <Border BorderThickness="0" Background="#FF454D52"/>
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Foreground="White" Padding="50,0,0,0"/>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="White"/>
            <Label HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="24" Foreground="White" Padding="0,0,50,0"></Label>
        </Grid>
    </Grid>



</Grid>

1 个答案:

答案 0 :(得分:2)

在最上方的网格上设置SnapsToDevicePixels

<Grid SnapsToDevicePixels="True">