1. 모듈에 다음의 API 와 상수를 선언합니다.
Public Declare Function GetAsyncKeyState Lib "user32" _
(Byval vKey as Long) as Integer
Public Const VK_LBUTTON = &H1
Public Const VK_RBUTTON = &H2
2. 폼에 하나의 라벨과 타이머를 만들고 다음과 같이 코딩하세요
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_LBUTTON) then
Label1.Caption = "왼쪽버튼 클릭"
ElseIf GetAsyncKeyState(VK_RBUTTON) then
Label1.Caption = "오른쪽버튼 클릭"
Else
Label1.Caption = ""
End If
End Sub
첫댓글 잘 됩니다.