raising alarm in vb.net

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
hello,
in vb.net , i want to raise alarm .ie
for every 1 hour i want to display one reminder message to the user stating some information.

thank u .
 
add a timer control to the form and set it's interval property to 1000

have a form level integer
then in the tick event just add one to that integer (it'll be incremented once a second) then check to see if it's >= 3600 (an hour) if it is display the info you want to show the user, if not then have it do nothing till the next time the tick event fires

if you'd like code showing this concept feel free to ask myself or kulrom and we'll glady provide a working example
 
Why not just set the timer to tick once every hour. That way you have no need of the extra variable and unnecessary Tick events. If you want it to display this message on the hour, i.e. the big hand is on the twelve rather than the app has been running for an hour, you would have to calculate the appropriate interval for the first tick then set the interval to 1 hour in the Tick event handler.
 
query reg alarm

i ll be very glad if one example is given for reference.
thank u
JuggaloBrotha said:
add a timer control to the form and set it's interval property to 1000
have a form level integer
then in the tick event just add one to that integer (it'll be incremented once a second) then check to see if it's >= 3600 (an hour) if it is display the info you want to show the user, if not then have it do nothing till the next time the tick event fires

if you'd like code showing this concept feel free to ask myself or kulrom and we'll glady provide a working example
 
Great, only you need to replace line mintSeconds = 0 cause if user doesn't satisfy dialogBox it will continue open new dialogs ... so your code should look like:
PHP:
 {...} 
 
If mintSeconds >= 3600 Then
mintSeconds = 0
 
MessageBox.Show("It's been an hour", "An hour has passed", MessageBoxButtons.OK, MessageBoxIcon.Information)
 
' mintSeconds = 0	.... move this to the above
 
EndIf

Anyway good job ... cheers ;)
 
hello

my code for updating a record is programatically is

Try

ss = "Update bankdet1 Set bankname1='aaa',bankacc1=111 where facode1=33"

cmd =
New SqlCommand(ss, cn)



cn.Open()

cmd.ExecuteNonQuery()

cn.Close()

MsgBox("record updated")

Catch x As Exception

MsgBox(x.Message)

EndTry

but i want to do this at runtime
can u givea small example demonstrating updatecommand
thk u

kulrom said:
Great, only you need to replace line mintSeconds = 0 cause if user doesn't satisfy dialogBox it will continue open new dialogs ... so your code should look like:
PHP:
 {...} 
 
If mintSeconds >= 3600 Then
mintSeconds = 0
 
MessageBox.Show("It's been an hour", "An hour has passed", MessageBoxButtons.OK, MessageBoxIcon.Information)
 
' mintSeconds = 0	.... move this to the above
 
EndIf

Anyway good job ... cheers ;)
 
Back
Top