How to prevent the content of a textbox from being selected

csharp Taiwan
  • 13 years ago

    Dear All,

    I am putting a textbox or masked textbox in a program.  Yet, I don't wanna the content of the box to be selected by a mouse doubleclick or something.   And I don't want the cursor shown in the box. How can I do that?  Many thanks in advance.


  • 13 years ago

    Set the "ShortcutsEnabled" property to "False" so that the TextBox doesnot allow the contents to be copied.

    Set the tabStop property to False.


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray