I am creating RichTextBox control with customize text color, font size, etc.When I tried to make this RichTextBox to be dockable using UltraDockManager, my font style (color, size, etc) get lost everytime I dock/float.
I have attached my example code for reference.
Please someone give me solution for this,
Thanks before.
Thanks for the reply.
I have played with RichTextBox on the last few days. And base on my research, RichTextBox has unique behavior. If we set text color using SelectionColor (like in my code), the color will got reset when RichTextBox.Font or RichTextBox.Text changed.
And then I tried to create user control inherit from RichTextBox. I override method OnFontChanged and OnTextChanged just for test purpose. When I tried docking/floating both of them triggered!
Perhaps somewhere in Infragistics library makes changes to the Font?
And really thanks for the suggestion, I will try UltraFormattedTextEditor for the time being as I need to solve this as soon as possible :)
This is really a million dollar question. I played around with this in my free time over the last day which probably resulted in a few hours wasted and still wasn't able to figure it out. I partly believe it's Microsoft related because not any events relating to the RichTextBox's content is touched. It just removes the formatting on itself.
Since the RichTextBox could be an annoyance to work with while the question is unanswered, you could use the work around of using the UltraFormattedTextEditor control instead.