Premium Only Content
Learn Visual Basic 6 VB6 Alarm Clock Part 2
Welcome to part 2 of project 2 making a alarm clock ..
My name is Gym and today were going to be moving on with the coding part of our second project
Ok lets got on with it,, this line of code is only 1 of 2 most complicated lines in the whole program,, and ill try to explain to you what its saying.
If Time = (Text1.Text) & ":" & (Text2.Text) & ":00 " & (Text3.Text) Then
we use brackets because then it means the object text1..
if we used quotation marks then it means that exact thing written,, in other words it would only sound the alarm when the time read text1.text..
lol and I'm not shore what hr of the day that is..lol.
Ok after the then its timer4.enabled = true and timer4.intervull = the length of you wav file you have selected,, now remember that 1 second = 1000 so if you have file is 3 secs long you want the interval to be 3000.. to find out the leant of your wav file right mouse click then properties .
then finish i of with end if
Ok now in Timer 3 we want to right
if option1 ="1" then
Text3.text = "AM" 'in capitals
else
Text3.text = "PM" 'in capitals
Okays now in form load we need to have timer 3 switched on from load up so instead of typing it all out again just copy timer 1 enabled with interval and past it below and change t it from timer 1 to timer 3
Now we have to do the on and off button so in the on button we right timer2 enabled = true and then interval =1 and then we want the caption to change in our status label so we right label 2 caption = "Alarm is on" don't forget the quotations
Then in the off button we need it to say timer 2 enabled = false and then
Label 2 caption = "alarm is off"
and we also what to have that button to not only turn off the timer that tells wether the times mach we want to use it to turn off our wav file once it has sounded so we right timer4. Enable = false
Ok now here is the hardest bit of them all... we want to use the drop down box to find general and then make shore it sees dilacerations,,,
And in their we going to right
Private Declare Function Playwave Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Call Playwave("Alarm.WAV", 3)
-
1:04:39
Crypto Power Hour
10 hours agoState of Early Stage Crypto Investor Rob Good
13.6K7 -
1:24:24
LIVE WITH CHRIS'WORLD
16 hours agoTHE WAKE UP CALL - 12/17/2025 - Episode 27
4.22K -
27:51
ThinkStory
18 hours agoIT: WELCOME TO DERRY Season 1 Ending Explained!
4.91K -
5:29
Gamazda
12 hours ago $0.94 earnedMetallica - Nothing Else Matters (Live Piano in a Church)
4.26K3 -
2:50:56
The Confessionals
20 hours agoHe Killed a Monster (Then They Told Him to Stay Silent)
5.42K6 -
41:42
Brad Owen Poker
14 hours ago $0.31 earnedMy BIGGEST WIN EVER!! $50,000+ In DREAM Session!! Must See! BEST I’ve Ever Run! Poker Vlog Ep 360
4.02K -
17:53
The Illusion of Consensus
18 hours ago $0.39 earnedWhat Women REALLY Want in Public (It’s Not What You Think) | Geoffrey Miller
4.57K1 -
1:32:16
Uncommon Sense In Current Times
17 hours ago $0.32 earnedPolygyny Debate: The Biblical Case For and Against Plural Marriage | Uncommon Sense
8.27K -
LIVE
BEK TV
23 hours agoTrent Loos in the Morning - 12/17/2025
99 watching -
23:42
Athlete & Artist Show
4 days ago $0.41 earnedWorld Junior Invites & Snubs, NHL Threatens To Pull Out Of Olympics
6.19K