-2

How I can fix it?

[enter image description here

<CheckBox
    x:Name="///"
    Grid.Row="3"
    Grid.Column="0"
    IsChecked="{Binding ///, Mode=TwoWay}"
    Style="{DynamicResource ///}" HorizontalAlignment="Left">
    <CheckBox.Content>
        <TextBlock
            Grid.Row="3"
            Grid.Column="0"
            Style="{DynamicResource ///}" />
    </CheckBox.Content>
</CheckBox>

I need to align this square to the left and the text to the right but for some reason the square is constantly centered

j.doe
  • 35
  • 5
  • You might want to add some info on what your problem is and what you are trying to achieve. [How to ask a question](https://stackoverflow.com/help/how-to-ask). – Sajith Sageer Sep 28 '18 at 07:10
  • I need to align this square to the left and the text to the right but for some reason the square is constantly centered – j.doe Sep 28 '18 at 07:33
  • I can't seem to reproduce the issue. Can you try removing your styles and see if the problem persists. Or post your styles here – Sajith Sageer Sep 28 '18 at 08:26

1 Answers1

0

I don't think you need to set the content. You can define a TextBlock inside the Checkbox

<CheckBox>
    <TextBlock Text="MyCaption" />
</CheckBox>

Square to the left and label to the right is the normal behavior. Doing it the other way around is tricky.

Robin Bennett
  • 3,192
  • 1
  • 8
  • 18