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
Printable View
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
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]
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
isn't hidding the form enough? Explain what you mean
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]
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
I forgot to mention that the method I gave you will check the time in military time format.
Thanks
Wayne
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.