CodeItBetter Programming Another VB Programming Blog

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

Related posts:

  1. How to select all text with Ctrl+A in a text box
  2. How to select all text with Ctrl+A in all TextBoxes in a form
  3. How to Ignore Specific Characters in TextBox
  4. How to allow users to increase and decrease the value using Up and Down arrow keys in a text box
  5. How to Prevent the user from entering invalid keys in a text box.
  6. How to allow only number and only one occurence of decimal character in text box
  7. How to allow only number in a text box
  8. How to Disallow numeric input in Text box
  9. How to Link a text box to a list box? So, as you type, it highlights any matching entries
  10. How to control what type of alphanumeric character is entered into a text box at a particular postion in the text box.

Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.