0

Hello world of DaniWeb, it's been months since I last visited this forum but here I am asking for your help again :)

I've been developing a text editing application and my problem is that the RichTextBox control will "lose" all special formatting (like font, color etc.) when enabling WordWrap. Can you please help me out on this one?

P.S: If you need any code in order to help me solve this problem, just let me know and I'll post it right away!

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by TechSupportGeek
2

See if this helps, if not, do post code.

Dim tempStr As String = RichTextBox1.Rtf '// store Format into String.
        RichTextBox1.Clear() '// clear if needed.
        If RichTextBox1.WordWrap = True Then : RichTextBox1.WordWrap = False : Else : RichTextBox1.WordWrap = True : End If '// toggle WordWrap.
        RichTextBox1.Rtf = tempStr '// set Formated text back.
0

Edit: Double posted since DaniWeb took too long to Submit/Load webpage.

Edited by codeorder: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.