将复选框置于 WPF 数据网格中

问题描述 投票:0回答:1
wpf datagrid
1个回答
0
投票

尝试一下适合您的风格:

<Style x:Key="LargerCheckBoxStyle"
        TargetType="{x:Type CheckBox}">
    <!-- Use the margin instead of height and width-->
    <Setter Property="Margin"
            Value="25" />
    <Setter Property="HorizontalAlignment"
            Value="Center" />
    <Setter Property="HorizontalContentAlignment"
            Value="Center" />
    <Setter Property="IsHitTestVisible"
            Value="False" />
</Style>

结果

© www.soinside.com 2019 - 2024. All rights reserved.