<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" IsChecked="True" IsHitTestVisible="False"></CheckBox>
<TextBlock Grid.Column="1" Text="Test"></TextBlock>
</Grid>
设置IsHitTestVisible=false,checkbox不再能被命中,点击它相当于点击它下面那一层的控件,即TextBlock
示例代码
https://github.com/zLulus/NotePractice/tree/dev3/WPF/WpfDemo/CheckBox