Link to home
Start Free TrialLog in
Avatar of innovator2
innovator2

asked on

How to prevent selection of text in a text control (e.g. textbox or richtextbox

Hi all!
I have a richtextbox control which I want to make available to users.
They can read its contents but I don't want them to be able to select any text or copy them

What I have done
1. I set the property of the control to read only
2. I wrote this

 if(rtfCase.SelectedText.Length > 0)rtfCase.SelectedText = "";

in the MouseUp, KeyUp and SelectionChanged events of the RTF control, but no luck.
Can someone please help me out.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of rubixxcube
rubixxcube

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of innovator2
innovator2

ASKER

Thanks. It works fine.