Results 1 to 9 of 9

Thread: Time Alert

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    I would like to display a jpg on my screen at 12:00 noon to remind me of something.

    Anyone know where I can find sample code.

    Wayne

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    Timer

    Use A Timer. Set the interval to one minute. Hide the form.

    Then every time the timer event gets fired, test to see of it is 12:00. if it is then display the form, with a picture on it.

    [code]

    Dim WithEvents timer1 As Timer

    Private Sub Form_Load()

    Set timer1 = Me.Controls.Add("vb.timer", "timer1", Me)
    timer1.Interval = 60000
    timer1.Enabled = True
    Me.Hide

    Private Sub timer1_Timer()

    'test for 12:00
    If hour(time) = 12 then
    Me.Show
    End If

    End Sub

    [Edited by Iain17 on 03-28-2000 at 11:44 AM]

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Ok..I set this in the startup and it fires on startup...Is there a way that it can be invisible...I don't want a co-worker to close the application and as a result, I miss running my job.

    Ie..I am using it as a sort of scheduler to remind myself to run certain jobs at specific times so I need it to be running. If it's invisible then no one can turn it off accidentally or otherwise.

    Wayne

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    hidden

    isn't hidding the form enough? Explain what you mean

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    1st...is there a function for minuites as well
    ie...12:45 am

    2nd..when you run a vbApp the icon appears in the task tray...therefore it is visible and can be clicked on and closed...

    [Edited by HeSaidJoe on 03-28-2000 at 12:15 PM]

  6. #6
    Member
    Join Date
    Mar 2000
    Posts
    32
    There is a property of Forms call ShowInTaskBar, and you need to set that to false so that it will not show it there.

    About the minutes if you change:

    If hour(time) = 12 then

    to

    If format(time, "hh:mm") = 12:45 then

    that should take of it

  7. #7
    Member
    Join Date
    Mar 2000
    Posts
    32
    I forgot to mention that the method I gave you will check the time in military time format.

  8. #8

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Thanks
    Wayne

  9. #9
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145

    No turning off!

    You can also make the app impossible to turn off (I use it for my reminder-apps).
    I don't remember the exact code, but in Form_Unload (Cancel As Integer) you put something like:

    Msgbox("Dont turn it off!")
    Cancel = -1


    When Cancel is set to -1 (or 1 or whatever it is), the termination is canceled. This is the same you use for questions like "Do you really want to close the program?", only here is no Yes-button.

    To close the app down, use Ctrl-Alt-Del

    Cheers, Pentax

    PS.
    This can of course be somewhat irritating for your co-worker.
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width