by Julito Amodia (8 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 13th May 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This is just a sample program on how to use the system date on a form. This program having unique codes in visual basic6.
API Declarations
Option Explicit
Dim strCurrTime() As String, strHMS() As String, strCurrDay() As String
Dim dtToday As Date, strMeridian As String, strToday As String, strTime As String
Dim strHour As String, strMin As String, strSec As String
Dim strDay As String, strDate As String, strMonth As String, strYear As String
Dim nSec As Integer, lColorChanger As Long
strTime = Time
dtToday = Date
strToday = Format(dtToday, "dddd dd mmm yyyy")
'splits the hour, minute, second, and meridian
strCurrTime() = Split(strTime, " ")
strMeridian = strCurrTime(1) 'stores AM/PM data
strHMS() = Split(strCurrTime(0), ":")
strHour = strHMS(0) 'stores hour, min, and sec
strMin = strHMS(1)
strSec = strHMS(2)
lblTime.Caption = strHour & ":" & strMin
lblSec.Caption = strSec
lblMeridian.Caption = strMeridian
nSec = CInt(strSec)
'splits the day, date, month, and year
strCurrDay() = Split(strToday, " ")
strDay = strCurrDay(0)
strDate = strCurrDay(1)
strMonth = strCurrDay(2)
strYear = strCurrDay(3)
lblDay.Caption = strDay
lblDayBkgrnd.Caption = strDay
lblDate = strDate & "." & UCase(strMonth) & "." & strYear
lblDateBkgrnd.Caption = lblDate.Caption
lColorChanger = Int((&HFFFFFF * Rnd) + 1) 'Basta eGenerate lang niya ang random nga number sulod sa one hangtud 16million
shpBox.FillColor = lColorChanger 'Basta ilis-ilis sa color nga walay particular order
If nSec >= 1 And nSec <= 30 Then
shpBox.Left = 120 + ((nSec - 1) * 120)
ElseIf nSec > 30 And nSec <= 59 Then
shpBox.Left = 120 + ((nSec - 31) * 120)
ElseIf nSec = 0 Then
shpBox.Left = 3600
End If
End Sub
No comments have been posted about This is just a sample program on how to use the system date on a form. This program having unique c. Why not be the first to post a comment about This is just a sample program on how to use the system date on a form. This program having unique c.