How do keys make content in two lines? Special characters like \ n \ r can not be added.

  • You can put TextBlock as Content, set the width and TextWrapping, then it will increase in height to accommodate all the text. - Ivan Parfentev
  • Do you mean Button ? - Sam
  • Yes, it is Button. - AVM
  • Is the text of the button fixed or not known in advance? - Sam
  • No, the text is fixed. - AVM

1 answer 1

In the case of fixed text, you can use LineBreak , this will spread lines regardless of the width of the button:

 <Button Width="100"> <TextBlock TextAlignment="Center"> Это <LineBreak/> кнопка </TextBlock> </Button>