Hello
This sample sets the text alignment of MyButton to Right:
MyButton.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch;
TextBlock textBlock = new TextBlock()
{
Text = "Shahin",
TextAlignment = TextAlignment.Center
};
this.MyButton.Content = textBlock;
***
And if you want a
XAML code:
<Button Height="23" HorizontalAlignment="Left" Margin="190,115,0,0" Name="MyButton" VerticalAlignment="Top" Width="75" HorizontalContentAlignment="Stretch">
<TextBlock Text="Shahin" TextAlignment="Center" />
</Button >