How to ignore Ctrl+V and Shift+Insert key in a text box.
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 | 'Controls - How to ignore Ctrl+V and Shift+Insert key in a text box. ' Ignore Shift-Insert. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If (KeyCode = vbKeyInsert) And (Shift And vbShiftMask) Then KeyCode = 0 End Sub ' Ignore Control-V keys. Private Sub Text1_KeyPress(KeyAscii As Integer) Const CTRL_V = 22 If KeyAscii = CTRL_V Then KeyAscii = 0 End Sub |