Reputation: 121
I have a rich text box and a font dialog box. The problem is that when i highlight a certain string or group of strings then open the dialog box, the highlight color disappears. Although the changes are successful (like if i change the font family of a highlighted string it changes). For aesthetic purposes i would like to retain the highlight color, then remove it whenever the changes are done.
THANK YOU for the help!
Upvotes: 1
Views: 1251
Reputation: 501
The rich text box has a property called HideSelection
which is true by default. That causes the highlight to disappear when the text box loses focus (as it does when you open the font dialog).
Setting HideSelection
to false should cause the highlight to remain.
RichTextBox inherits this property from TextBoxBase:
http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.hideselection.aspx
Upvotes: 5