Text on the left side of checkbox in WPF?

Ivan Peric picture Ivan Peric · Jul 4, 2013 · Viewed 59.8k times · Source

What is the easiest way to put checkbox content (text) on the left side of the checkbox itself?

Answer

nmclean picture nmclean · Feb 13, 2014

A solution that maximizes "easiness" and "correctness" is to make a RightToLeft checkbox with LeftToRight content:

<CheckBox FlowDirection="RightToLeft">
    <TextBlock FlowDirection="LeftToRight" Text="CheckBox Content:" />
</CheckBox>

Or if you'd like a style:

<Style TargetType="CheckBox">
    <Setter Property="FlowDirection" Value="RightToLeft" />
    <Setter Property="ContentTemplate">
        <Setter.Value>
            <DataTemplate>
                <ContentControl FlowDirection="LeftToRight" Content="{Binding}" />
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>