How to prevent copying text in textarea

Good morning. Is there a way to prevent a user from selecting and copying (via ctrl-c or right click > copy) text that is present in a textarea? I have the properties for the textarea for Enabled = On and ReadOnly = On, but it still appears I am still able to select all, copy and paste into a text editor. It seems that Mac prevents this with command-c, but on Windows, I can still use ctrl-c to copy and then paste. If unable to disable this function completely, is there a way to alter the contents of the clipboard when someone does ctrl-c?

My app has a lot of informational content teaching students about nutrition, and I don’t want to give them any easy way (other than just typing everything if they are that adamant) of copying/pasting, and sharing with others

A couple options:

  1. In the SelChange event of the TextArea on the Window use code like this to cancel the selection:

Me.SelStart = -1 Me.SelLength = 0

  1. Subclass the TextArea and add the EditCopy and EditCut menu handlers with no code to override the default behavior.

Perfect! Thanks Paul!

Nota:
you cannot avoid the use of an OCR software who will give the text back from a graphics screen shot.

Or… if the text is important enough for some, it is possible to type it too.

I’ve done both (in the past, before the internet exists) for hobbies stuff.

Thanks Emile. I am aware of those possibilities and am ok with them. Just trying to make it a tad more difficult for someone to reproduce the content. My app is very content heavy. I’ve spent years and hundreds of hours developing the content for the study guide. I recently discovered that some users had been copying/pasting into a Word document and distributing to others. If they want to manually type everything out, more power to them. Eliminating the copy/paste function is just a way to prevent some from doing this and sparing the usefulness of the software

[quote=430318:@Emile Schwarz]Nota:
you cannot avoid the use of an OCR software who will give the text back from a graphics screen shot.

Or… if the text is important enough for some, it is possible to type it too.

I’ve done both (in the past, before the internet exists) for hobbies stuff.[/quote]

Actually there are lots of apps that can access the window content to be extracted. Just copy and paste.

A textarea is for edit the text, why not use a label, or better, a canvas?

I’ve got a lot of text in many of the textareas that require scrolling and/or holding many lines of text. Labels would get cut off, and I’m not sure how the canvas would work. The space is limited on the window, so I cannot have each label/canvas growing when the amount of text is great

For now, I think the Me.SelStart = -1 and Me.SelLength = 0 will work for the intended purpose. I may try to play around with other options of altering the clipboard or just keep as is for now