journay
journay

Reputation: 23

Is there any way to change the line height of a TextBox in a uwp app?

Is there any way to change the line spacing or line height of a TextBox in a uwp? wpf:

TextBlock.SetLineHeigh(textboxName, 30)

but uwp is not allow?

Upvotes: 1

Views: 589

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

Is there any way to change the line spacing or line height of a TextBox in a uwp?

UWP TextBox does not support set line height. Please use RichEditBox to replace.

Derive from rob's reply,

RichEditBoxcan represent rich text. The RichEditBox's underlying engine is more similar to the one in WordPad.

You can change the formatting in the RichEditBox by manipulating properties on the Document. You can set the line spacing by getting an ITextRange's ParagraphFormat and callingITextParagraphFormat.SetLineSpacing method.

Upvotes: 1

Related Questions