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.

    cyhsu999

  • 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).

Contribute

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.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr