views:

1220

answers:

2

I want the content of a wpf button to be left aligned I tried the following but the text is still centered inside the button.

    <Button >
        <StackPanel HorizontalAlignment="Stretch">
            <TextBlock HorizontalAlignment="Left" Text="Save"/>
        </StackPanel>
    </Button>

What do i do?

+2  A: 

Found it, it's HorizontalContentAlignment.

:)

Jose
A: 

You don't need the StackPanel or the TextBlock. All you need is

<Button HorizontalContentAlignment="Left" Content="Save" />
Bryan Anderson
my actual implementation had two elements in the content, my example didn't
Jose