Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Learn VB6 basics 6.0 tutorial 2 part 2 Make a Alarm Clock

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
30,509
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 21, 2008

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)

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (Gymjunnky)

  • OK the reason so many people are having problems with this is because the code is old and windows has changed.. any one not running XP mite well forget about trying this and then if you still might have probs... one day ( if i ever get time ) ill make up a new one with a much simpler code that works on modern windows ...

  • okay where do i type the name for my .WAV file in source code ??

  • Full source code and help forums on the site mate

  • If you need help goto my website and ask in help forums

  • I am using VB 2008. I managed to work everthing else fine and add the declaration then this comes up with the timer4 code Argument not specified for parameter 'uFlags' of 'Declare Ansi Function Playwave Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As String, uFlags As Long) As Long'

  • Thers help forums on my site were u can get help with basic programing Qs if you have a look my channel u can find the link the url is my user name. coom

see all

All Comments (69)

Sign In or Sign Up now to post a comment!
  • the sound isn't working.

  • Hey, The sound is not working.

    Please explain the sound code in details so that i can set the sound for my clock myself.

  • It dosn`t sound!! please helps i´ve chek everithing a lot of times and the only problem is that the .wav file dose´t sound when the actual time and the setted time ,for the alarm to ring, match...

  • When it goes off it tells me the property value is invalid for my alarm's run time. I used a full song and put in how many seconds it was times 1000. Can I not do this or did I put the wrong value in?

  • Nice but slow

  • how do you get the sound to work

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more