Search code examples
wpf

CheckBox tick mirrored when changing FlowDirection


O.S. : Microsoft Windows 8.1 Developing Application: Microsoft Visual Studio 2013 (WPF App development)

I have moved from Windows 7 to Windows 8.1 and now my old apps which i had developed in VS2012 have a weird manner. because my language is right-to-left, i use RightToLeft for FlowDirection. it was working fine as all text was showing on the left side of CheckBox but now the tick sign of CheckBox is mirrored like this:

enter image description here

the tick sign is not correct even in a right-to-left language. is this because O.S. or the VS2013 and how can i fix it? do i need to create a template? thanks.


Solution

  • I had the same problem, and this is the best solution i found. The path is what draws the tick, so just changing its flow direction back to LeftToRight makes it draw as you would expect.

    <CheckBox Content="My Checkbox" FlowDirection="RightToLeft">
        <CheckBox.Resources>
             <Style TargetType="{x:Type Path}">
                   <Setter Property="FlowDirection" Value="LeftToRight"/>
             </Style>
        </CheckBox.Resources>
    </CheckBox>