Disable Ctrl + Insert on Windows Forms

  • Thread starter Thread starter Sumit
  • Start date Start date
S

Sumit

Hi all,

Is there any way to disable copy & paste options using ctrl + Insert &
Shift + Insert respectively on Windows forms using C#.

Kindly Help !!

Regards
Sumit Vohra
 
Set the form's KeyPreview property to True, then add a handler for the
KeyDown event as follows:

private void Form1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {
if (e.KeyCode == Keys.Insert && (e.Shift || e.Control))
e.Handled = true;
}

If you want to totally disable copy and paste you should also check for
Ctrl-C and Ctrl-V.

Chris Jobson
 
Back
Top