Zdravím použite pre to tento jednoduchý kód
Public Class Form1:Inherits System.Windows.Forms.Form
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private WithEvents timer As New System.Windows.Forms.Timer
Private downFlag As Boolean
Private mouseClicks%
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
timer.Interval = 1
timer.Enabled = 1
End Sub
Private Sub timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer.Tick
If GetAsyncKeyState(1) = 0 Then
If downFlag Then
downFlag = False
Me.mouseClicks += 1
End If
Else
downFlag = True
End If
Label1.Text = "Tlačítko stlačené " & Me.mouseClicks & "x"
End Sub
End Class
Viac o tom ako používať API sa dočítate v článku : http://www.vbnet.cz/clanek--94-skodorado... Vašo
|