| | |
Text Timer
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2007
Posts: 3
Reputation:
Solved Threads: 0
thanks a million for explaining the use of getsystemtime() .
i was luking for that particular peiece of onfo very badly.
it's really ossom
vidya
i was luking for that particular peiece of onfo very badly.
it's really ossom
vidya
•
•
•
•
Alright, I've Got It:
You Need To Add A Plain Ole Standard Module (It's A Good Practice), inside of the module add this:
Module Code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) Public Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long Public Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type
In your form load event, You'll need this code:
Form Load Code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim GMTime As SYSTEMTIME Dim TheTime As String GetSystemTime GMTime Text1.Text = GMTime.wHour & ":" & GMTime.wMinute & ":" & GMTime.wSecond & "." & GMTime.wMilliseconds For x = 1 To 10000 Print "Frost" Next GetSystemTime GMTime Text2.Text = GMTime.wHour & ":" & GMTime.wMinute & ":" & GMTime.wSecond & "." & GMTime.wMilliseconds Timer1.Interval = 1 Label1.Caption = ""
And Lastly in your timer event:
Timer Event Code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim GMTime As SYSTEMTIME Dim TheTime As String GetSystemTime GMTime Label1.Caption = GMTime.wHour & ":" & GMTime.wMinute & ":" & GMTime.wSecond & "." & GMTime.wMilliseconds
So Far, This works flawlessly for me. Let me know how it works for you.... if you need an additional help, let me know.
![]() |
Similar Threads
- Seconds timer (C++)
- Countdown Timer (VB.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Please Help..
- Next Thread: similar of paintpicture
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





