By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,149 Members | 885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,149 IT Pros & Developers. It's quick & easy.

Selection highlight visible for inactive control

GaryTexmo
Expert 100+
P: 1,501
This is driving me nuts, I can't find anything after numerous web searches, I'm hoping someone here has some insight. What I'd like is for the selected text on a control (rich text box in this case) to remain highlighted when the control is inactive.

To see an example of what I want, simply open notepad, type some things, select what you typed, then click another window. The text will remain highlighted even though notepad is inactive.

To see an example of what I don't want, create your own form in Visual Studio and put a multiline text box (or rich text box, doesn't seem to matter) on it. Run your app and type some things in the text box, then highlight it and leave focus on the form. The highlight magically disappears.

Any help would be greatly appreciated!
Jul 16 '09 #1

✓ answered by cloud255

Hi

There is a property called 'HideSelection' exposed by the RichTextBox control. Simply set this property to false and you will have the desired effect.

Share this Question
Share on Google+
2 Replies


Expert 100+
P: 427
Hi

There is a property called 'HideSelection' exposed by the RichTextBox control. Simply set this property to false and you will have the desired effect.
Jul 17 '09 #2

GaryTexmo
Expert 100+
P: 1,501
That's exactly it, thank you! And now that you've pointed it out, it's painfully obvious... it's there for both a rich text box and a text box.

...can't find the forest for the trees...

Thank you again!
Jul 17 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.