How to restore default style for CheckBox on ToolBar?

The problem is that ToolBar will change the style of the placed CheckBox without any changes (instead of checking the box, it looks like a regular button). I want to restore the original look of CheckBox with minimal code.

This problem is the opposite of the problem described here: How to apply the CheckBox ToolBar style to a regular CheckBox?

Any help please?

+5
source share
3 answers

You are probably looking for:

<CheckBox Style="{x:Null}" />

This should restore the default checkbox style.

+5
source

... : o) . , , , , Dockpanel, , CheckBox.

- :

<DockPanel>
    <CheckBox Content="Check 1"/>
    <CheckBox Content="Check 2"/>
</DockPanel>
+3

I came across an answer. Try the following:

<BulletDecorator
    Margin="0,5,0,0">
    <BulletDecorator.Bullet>
        <CheckBox />
    </BulletDecorator.Bullet>
        <TextBlock
            Width="100"
            TextWrapping="Wrap"
            HorizontalAlignment="Left"
            Foreground="Blue"
            Margin="5,0,0,0">
    Some text
    </TextBlock>
</BulletDecorator>

with, of course, changes to suit your needs.

0
source

All Articles