Is it somehow possible to prevent end users from copying text from RichTextBox
in a C# application? Maybe something like adding a transparent panel above the RichTextBox
?
http://www.daniweb.com/software-development/csharp/threads/345506
Re: Disable copy and paste control for Richtextbox control Two steps to be followed to disable the Copy-Paste feature in a textbox,
1) To stop right click copy/paste, disable the default menu and associate the textbox with an empty context menu that has no menu items.
2) To stop the shortcut keys you'll need to override the ProcessCmdKey method:
C# Syntax (Toggle Plain Text)
private const Keys CopyKey = Keys.Control | Keys.C;
private const Keys PasteKey = Keys.Control | Keys.V;
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
if((keyData == CopyKey) || (keyData == PasteKey)){
return true;
} else {
return base.ProcessCmdKey(ref msg, keyData);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With