[Guide] Your own alarm menu

User Tag List

Results 1 to 1 of 1
  1. #1
    warsheep's Avatar Contributor
    Reputation
    184
    Join Date
    Sep 2006
    Posts
    1,216
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide] Your own alarm

    This is a very simple code, which will check every second if the time is the specified time.

    Place two trackbars, a timer, a label and a button.

    1. trackbar
    Set the minimum to zero, and max. to 24.

    2. trackbar
    Set the minimum to zero, and max to 60.

    The timer
    It should be off by default, and the time intervall should be somewhere between
    1000 (A second) and 59000 (59 seconds). I set mine at one second.

    And the button,
    which basicly will be the on button. Set it up as you want.


    ------------ The code -----------

    Now, at first, just let me say that I got no idea how a 'professional' would do this,
    I am writing this guide so I can get feedback for my coding style, not to tell
    what is right and wrong.


    Right under "public class form1", write
    Code:
        Dim thehour As Integer
        Dim theminute As Integer
    This will create two variables, which only accepts numbers.

    Forexample, I can store 24, and 14 in them, but not twentyfour, or fourteen.


    And the most important part, the timer.
    Every time the timer "ticks", this code will run.
    Basicly, it will check if the time we currently have match what the alarm is set to
    go off at.
    Code:
            If TimeOfDay.Hour = (thehour) And TimeOfDay.Minute = (theminute) Then
                Process.Start("Countdown")
                Me.Close()
            End If
    The if statement will check if the time matches the variable "theour", and the
    time match "theminute".

    Where I have "process.start(""), you can have whatever you want to happen
    when the alarm goes off to do. If you want a beep, you can write
    Media.SystemSounds.Beep.Play()

    I have chosen to make it start a second program with my alarm sounds and stuff,
    it's easy to set up.

    But, we need to set the value of our variables, and that's where the trackbars
    come in.

    The first one, with the settings 0-24, is obviously for hours, while the 1-60 is for
    minutes.


    So, double click on the hour trackbar, and write
    Code:
            thehour = TrackBar1.Value()
            TextBox1.Text = ("H" & thehour & " M" & theminute & " ")
    Now I've started to use the textbox, to show when the alarm will go off.

    It is both rather self explainatory. If it is set to go off at 12:30, the textbox
    will display "H12 M30".


    Now, what's left, is to make the button start the timer, and that should be it.

    Some hints:
    Set the textbox to not be editable, it may be confusing.
    Set the button to hide the trackbars and button, perhaps make it display
    a button which can turn the alarm off...
    To make it beep, make it start another timer when it goes off, and make it
    beep every second or so.

    I hope someone will learn anything from this tutorial!
    An example project will be uploaded soon, writing this in class. >.<
    Last edited by warsheep; 11-12-2008 at 06:33 AM.
    FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.

    [Guide] Your own alarm

Similar Threads

  1. [EASY] Make your own Alarm
    By Mitron in forum Programming
    Replies: 0
    Last Post: 04-20-2009, 03:26 PM
  2. [Guide] Making your own malls
    By Denelly in forum WoW EMU Guides & Tutorials
    Replies: 38
    Last Post: 02-28-2008, 06:50 PM
  3. The Complete Guide On Setting Up Your Own AC-Web Server! (Guide Downloads)
    By Absolute Zero in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 02-13-2008, 10:49 AM
  4. [GUIDE]Stuff your own music into WoW. [Pictures]
    By Macroman in forum WoW ME Tools & Guides
    Replies: 22
    Last Post: 10-23-2007, 06:34 AM
  5. Reputation Guide. Very long, read at your own risk.
    By xlAnonym0uslx in forum World of Warcraft Guides
    Replies: 5
    Last Post: 12-07-2006, 11:58 AM
All times are GMT -5. The time now is 10:07 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search