Skip to content

How to change text of specific line in multiline textbox in WPF? #3026

Closed Answered by nicolaihenriksen
VahidEra asked this question in Q&A
Discussion options

You must be logged in to vote

@VahidEra This question does not seem related to MaterialDesignInXamlToolkit in any way, but a general WPF question? I think there are probably other more appropriate forums for such a question.

With that said, I think what you are asking is somewhat of a special case which is difficult to provide a generic solution for. A TextBox can be "multiline" in various ways:

  • You can set AcceptsReturn=True (which is probably your scenario) where each line is separated by a Environment.NewLine string.
  • You can set the TextWrapping property to one of the "wrapping" options.
  • You can have a combination of the two above.

For the first scenario, it could be straight forward by simply pulling out the Tex…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@VahidEra
Comment options

@VahidEra
Comment options

Answer selected by Keboo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants