The usual way is to call it in a module and use the function in your code.
Add a module to your project and past the following ones...
Code:
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Public Function GetTicks() As Long
GetTicks = GetTickCount()
End Function
In your Form(s), you just need to call it..
Code:
Option Explicit
Dim TickValue As Long
Private Sub Form_Load()
Command1.Caption = "Start"
Command2.Caption = "Stop"
Text1.Text = ""
End Sub
Private Sub Command1_Click()
TickValue = GetTicks
End Sub
Private Sub Command2_Click()
TickValue = GetTicks - TickValue
Text1.Text = TickValue
End Sub
HTH
Last edited by mister_e; - 7th January 2008 at 21:33.
Reason: Long instead of double :o)
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks