·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Für dieses Beispiel brauchen Sie ein Modul und eine Form mit einem Commandbutton und einem Label.

' #####
' Modul
' #####
Public Declare Function SetTimer Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent As Long, _
    ByVal uElapse As Long, _
    ByVal lpTimerFunc As Long _
) As Long

Public Declare Function KillTimer Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent As Long _
) As Long

Public Sub Zaehler()
' Intervall = 1 Millisekunde
    Static i
    i = i + 1
    Form1.Label1.Caption = i
End Sub

' ####
' Form
' ####
Private Sub Command1_Click()
    Call SetTimer(Me.hwnd, 0, 1, AddressOf Zaehler)
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Call KillTimer(Me.hwnd, 0)
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.446 Sekunden ·  Dateigröße:  2656 Bytes