views:

162

answers:

2

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 suitable for what I am doing).

Thanks in Advance

A: 

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.

Fredrik Mörk
+3  A: 

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.

tanascius