开发者

TextBox - Can I keep the selection highlight when it loses focus?

开发者 https://www.devze.com 2023-01-01 20:07 出处:网络
I would like to have a regular TextBox on my form, where the selected text is still highlighted even if you use another control, e.g. push a button.

I would like to have a regular TextBox on my form, where the selected text is still highlighted even if you use another control, e.g. push a button.

Does anyone know a way to achieve this (without using a RichTextBox which is not su开发者_开发技巧itable for what I am doing).


Sounds like you are looking for the HideSelection property:

Gets or sets a value indicating whether the selected text in the text box control remains highlighted when the control loses focus.


The HideSelection property is your friend. Set it to false and you should get what you are looking for. I never quite understood why the default is true.

0

精彩评论

暂无评论...
验证码 换一张
取 消