在WinForm中,我们可以设置CheckBox的BackColor

我如何在WPF中执行此操作?我试试
<CheckBox Content="CheckBox" Background="Red"/>
Run Code Online (Sandbox Code Playgroud)
但这只会改变矩形边框颜色

我也试试
<CheckBox>
<TextBlock Text="CheckBox" Background="Red"/>
</CheckBox>
Run Code Online (Sandbox Code Playgroud)
但这只会改变文本背景颜色,不包括矩形

=======
谢谢大家的解决方案.我认为最简单的方法对我有用:)
如果您尝试使用面板进行一些实验:
<Grid Background="Red" HorizontalAlignment="Left">
<CheckBox Content="test" />
</Grid>
Run Code Online (Sandbox Code Playgroud)
非常接近你想要的.我自己试过;-)
| 归档时间: |
|
| 查看次数: |
3940 次 |
| 最近记录: |