0

I have a fairly complex form with square buttons labeled in German language. There is not enough space on the buttons for the whole text so the designer would split it somewhere into a second line when it runs out of space. Unfortunatelly in German this is an absolute nogo, there are strict hyphenation rules. Is there a way to let the Designer know where to split a text?

I tried to use a space at the correct position, and then the word is split correctly but the layout of the text is no more centered...

pb_SKAT
  • 163
  • 2
  • 14
  • If you set the `TextAlign` property of button to `Center` (which is the default value for text align) even when using a long text, the text would be center-aligned. Test using this text *"This is a long long text on button that you really should avoid using"*. Or maybe you are asking something else? – Reza Aghaei Dec 27 '15 at 19:37
  • Inserting "\r\n" breaks. Click on the down arrow of the Text property if you need to enter it in the Properties window. – Hans Passant Dec 27 '15 at 20:40
  • Thank you for the reactions. @Hans Passant: \r\n does not work, this will be literally displayed as part of the button's caption by WinForms. And yes the TextAlign property is set to Center. I try again: The button size is 60x60 pixels and using Segoe UI 9pt font it shows the word BENUTZER. The whole word does not fit, so the Designer splits it BENUTZ ER while I would need it to be splittet at BENUT ZER but I don't know how. When I insert the blank the hyphenation would be correct but then the first part isn't centered anymore. – pb_SKAT Dec 28 '15 at 14:13
  • Do **not** type \r\n into the Text property, it only works in string literals. Use the dropdown button. – Hans Passant Dec 28 '15 at 14:48
  • Thank you Hans, after I eventually understood what you mean - it works. For all those people who take a bit longer, e.g. myself: on the properties box of the button place the cursor in the Text property. The on the right edge a little down arrow appears - click on it. A small windows with the caption of the button opens. Place the cursor to the position where you want to split the text and hit the Enter-Key. The text will split in the text window but would remain unchanged in the Text-Propety (wich means in the future there will be no way to find this spot again...) :-) – pb_SKAT Dec 28 '15 at 18:17

0 Answers0