对象是使用 TAB 键还是鼠标激活的
2009-1-5 21:12:32 来源:互联网对象是使用 TAB 键还是鼠标激活的
声明:
Declare Function GetKeyState% Lib "User32" (ByVal nVirtKey%)
Const VK_TAB = 9
使用:
Sub Text1_GotFocus ()
If GetKeyState(VK_TAB) < 0 Then
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
' 使用了 TAB 键
Else
Text1.SelLength = 0
' 使用了 MOUSE
End If
End Sub
[1]
