J
John C.
I have a form with a text box. It is enabled and not
locked.
I want to sendkeys to the text box to place
(1) 'CTRL+1
(2) 'CTRL+2
(3) 'CTRL+3
...up to CTRL+9
Private Sub Text0_KeyDown(KeyCode As Integer, Shift As
Integer)
Select Case Shift
Case 2
If KeyCode >48 and KeyCode < 57 Then
SendKeys "+9" 'Shift+9 to place left paren
SendKeys KeyCode-48 'Place numeric
SendKeys "+0" 'Shift+0 to place right paren
KeyCode = 0 'Cancel anyother keystroke
End If
End Select
End Sub
I can not get the code to work...
locked.
I want to sendkeys to the text box to place
(1) 'CTRL+1
(2) 'CTRL+2
(3) 'CTRL+3
...up to CTRL+9
Private Sub Text0_KeyDown(KeyCode As Integer, Shift As
Integer)
Select Case Shift
Case 2
If KeyCode >48 and KeyCode < 57 Then
SendKeys "+9" 'Shift+9 to place left paren
SendKeys KeyCode-48 'Place numeric
SendKeys "+0" 'Shift+0 to place right paren
KeyCode = 0 'Cancel anyother keystroke
End If
End Select
End Sub
I can not get the code to work...