1

This issue is same as 2619535.

The given solution is working fine for me if there are no other keyboard events. Unfortunately it is breaking copy/paste events from keyboard. How to keep Ctrl + c and Ctrl +v functionality intact with this. I am not able to use these shortcuts for copy/paste.

Please assist.

Thanks in advance.
Vijay

Community
  • 1
  • 1
VJOY
  • 3,752
  • 12
  • 57
  • 90

1 Answers1

0

Try this code, it works for not copying the data

Private Sub Form1_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Deactivate
    Clipboard.Clear()
End Sub

and you can set the datagridview into readonly properties to avoid pasting data on datagrid

Bryan
  • 1,245
  • 5
  • 22
  • 37
  • I want to keep existing Copy/Paste functionality. Along with the new addition for ctrl + h. – VJOY Oct 07 '11 at 09:04