【问题标题】:Remove lines between rows in WPF grid删除 WPF 网格中的行之间的线条
【发布时间】:2019-05-17 21:04:53
【问题描述】:

我在 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>

【问题讨论】:

    标签: wpf


    【解决方案1】:

    在最顶层的网格上设置SnapsToDevicePixels

    <Grid SnapsToDevicePixels="True">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 2019-12-11
      • 2013-08-31
      • 2017-02-07
      • 1970-01-01
      • 2021-01-06
      相关资源
      最近更新 更多