VB 程序设计

10个成员

将ENTER变成TAB键

发表于 2016-12-27 3954 次查看
Public Const VK_TAB = &H9
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte,  ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        KeyAscii = 0
        keybd_event VK_TAB, 0, 0, 0
    End If
End Sub

 

发表回复
你还没有登录,请先登录注册