سلام
باید یک TextBox از TextBox ویندوز مشتق کنید و متد WndProc رو Override کنید.:
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_PASTE || m.Msg == WM_COPY || m.Msg == WM_CUT)
{
// ignore input if it was from a keyboard shortcut
// or a Menu command
}
else
{
// handle the windows message normally
base.WndProc(ref m);
}
}
برای کلیدهای ترکیبی:
if(e.KeyCode == Keys.C && e.Control) {
MessageBox.Show("NOT ALLOWED");
}
As for stopping the copy operation, it should be as easy as:
e.SuppressKeyPress = true;
And you can always clear the clipboard using:
Clipboard.Clear();