keeping highlighted text visible in a form that does not have focus

  • Thread starter Thread starter njuneardave
  • Start date Start date
N

njuneardave

Hey,

Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(


Thanks so much!
 
njuneardave said:
Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(

You didn't specify, but I'm assuming the highlighted text is in a TextBox?
If so, set the TextBox's HideSelection property to false.
 
hey, thanks for the reply! I'm sorry about not specifying, but I am
using an RTB. You hit the nail on the head. Thanks so much for your
help!!!!
 
Hi Dave,

The same HideSelection Property can be applied for RichTextBox as well.

You can use:

Code:
yourRTB.HideSelection  = false;

to keep the selected text remains highlighted even the rtb loses focus.

HTH.


Hugh Van.
 
Back
Top