vb6 Sendkey with Vista

I typically turn on the keypreview property so that I can trap the enter key and transform it to the tab key so that my users can use either the tab key or the enter key to shift focus to the next tab stop.

However, since upgrading to the Vista Operating system.  The enter key gets trapped as usual but when converting the keystroke to a tab key it does not get sent.  Here is the code that I use for this functionality.  Any Suggestions

The compiled code works as usual, but in the IDE the Sendkeys "{TAB}" is ignored.

 

Private Sub Form_KeyPress(KeyAscii As Integer)
        Call TabEnter(KeyAscii)
End Sub

Public Sub TabEnter(KeyAscii)
           If KeyAscii = 13 Then
            KeyAscii = 0
            SendKeys "{TAB}"
       End If
   
   
      If KeyAscii = vbKeyEscape Then

           KeyAscii = 0
           SendKeys "+{TAB}"
      End If


End Sub




Answer this question

vb6 Sendkey with Vista