Search code examples
wpftextblock

How to set height of textblock/textbox to 3 lines?


I can set fixed height in pixels, but i'd like to set it in lines. Sort of like in html you can set height of an textarea to number of rows/lines.


Solution

  • Try 3em

    1em is equal to the current font size. 2em means 2 times the size of the current font. E.g., if an element is displayed with a font of 12 pt, then '2em' is 24 pt.