How to wrap text in a Button in WPF?

Published on Monday, November 14, 2011
wpf

You have multiple ways to wrap text in a button. Here some sample code:

<Button> 
   <TextBlock>Two<LineBreak/>Lines</TextBlock>  
</Button>

Button button = new Button 
{ 
    Content = new TextBlock { Inlines = { "Two", new LineBreak(), "Lines" } } 
};