Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Messagebox With Countdown


hey guys, is it possible to put a countdown timer in a messagebox or do i need to create my own messagebox ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Countdown
I'm counting the time with milisecs and I want to pass to the format MM:SS:CC

MM -> Minutes
SS -> Seconds
CC -> Second/100

Could you help to pass to milisecs to the normal format (MM:SS:CC)?

Countdown
Hi all i want to make a countdown to 30th june. my code all ready looks like this

Code:
Public Sub Form_Load ()
label1.caption = date
end sub

Public Sub Timer1_Time ()
if label1.caption = "30/06/2002" then
label2.caption = "Yipee"
else
label2.caption = 'i need the code to make the caption say "this many days to go"
end if
end sub
thanks for anyhelp

Countdown
I have created this sub:


Code:
Private Sub Get_Time(ChosenDate As String)

TimeLeft = DateDiff("s", Now, ChosenDate)
Weeks = Int((((TimeLeft / 60) / 60) / 24) / 7)
Days = Int((((TimeLeft / 60) / 60) / 24) Mod 7)
Hours = Int(((TimeLeft / 60) / 60) Mod 24)
Mins = Int((TimeLeft / 60) Mod 60)
Secs = TimeLeft Mod 60

lblWeeks.Caption = Weeks & " weeks left"
lblDays.Caption = Days & " days left"
lblHours.Caption = Hours & " hours left"
lblMins.Caption = Mins & " minutes left"
lblSecs.Caption = Secs & " seconds left"

End Sub

It seems to work, yet, the minutes will tick down when the seconds are on 30 as opposed to 00...

any suggestions as to why this might be occuring would be welcome

CountDown :)
I would like to make a program that counts down to may15 ( That is when matrix2 is coming out ) and i cant seem to accomplish this...
I would like hours also... plz help... this is question of Life and death!

Countdown
Anyone who can help me please,

I make the program which can countdown from 10 to 0 and then unload the program if label caption="0", I use label and timer, the timer interval is 1000. The problem is when I run the program is very fast countdown so I can't see what happen. I try to use do-loop but nothing change.

please help me .

Countdown...
anyone here know how to program a countdown for the desktop? Like at countingdown.com or whatever? it doesnt need skins or anything sophiticated, it just needs to countdown...how would i go about doing this? thanks!

Countdown
What code do I need to enter at my timer so that it can countdown from a pre-set hour & minute to another pre-set hour & minute? My form contains one label (where the result appears) and two textboxes (hour & minute-from and hour & minute to). Thanks

Countdown
i am using this code to find out the seconds of the length of a song then convert to time.

Code:
Dim songlength As Integer

songlength = mp.Duration
Label1.Caption = Format(DateAdd("s", songlength, "00:00:00"), "hh:mm:ss")

now i can count up by doing this in a timer

Code:
Dim sec As Integer

sec = mp.CurrentPosition + 1
Label2.Caption = Format(DateAdd("s", sec, "00:00:00"), "hh:mm:ss")
how would i go about making it countdown from the duration to 0

thanks
thingimijig.

Countdown
hi, how would i go about makeing a label show a countdown to a time

so if the current time is 12:00:30 and the specified time is 12:10:00 then the result time would be 00:09:30

please help, ive tried everything i can think of but i keep getting numbers from -60 to 70

Countdown
I want to make a countdown timer, i first want a code to show the current computers time in Label1

Then another code to show days left in Label2.

Another thing, what windows form can i use to make the user enter his own destination date like his own birthday to count down days in Label2

20:00 Countdown
hello, I need to do a 20:00 countdown with a timer and display the time left in a label. How? *20 Minute Countdown* any help Appreciated!

Day-by-Day Countdown?
a few questions
1) how would i get the current day, then get how many days are left until a certain date?
2) how would i make the back colour of a form transparent, and only be able to see the from image (which is a transparent GIF image)
3) how would i make the program run automatically every time the computer starts up?

This is quite important to get done asap, so please help if you can.

Cheers

Countdown...
ok now to me this seemed simple. yet i cant get it to work correctly.

i want a simple label to count down 5..4...3...2...1...0 and then on zero shutdown.

now i know how to time it so it shuts down on 0 but on when i set this code in the timers for the label to change it dont work?

Timer1 Code: (set for 1 second)

label2.caption = "5"


Timer2 Code: (Set for 2 seconds)

label2.caption = "4"

and so on, but when it gets to 2, it starts going, 3, 5, 2, 1, 4, 0, 3, 2

and all the numbers start appearing out of order

Countdown
I need a vb equation to figure the amount of weeks to a certain date.

Doing A CountDown
How can I do a countdown with a Timer and a Label...

For example, let's say 10 seconds...


thnx,
squirrelly1

Countdown
Hi all....

I'm creating a Multiplicaion type quiz show program for my college assignment....yes i know, how boring - I have tried to make it as interesting as possible

I want to add a "progress bar" type countdown so when the progress bar has finished loading after say 20 seconds and they havent answered the question they get taken to the start..

I have never really used progress bar and dont know how i would do this, any help would be greatly appreciated.

Thanks

Countdown
how do i make a countdown from 10 with a one second interval with the decent of each number(the output will be in a label)

------------------
Steve Z

Countdown
Hi all!
I´m using the below code (think XTab posted it) to make a countdown of the number of seconds, minutes, hours and days
until a certain date. It work fine, but the different "counters" are not really in sync, they just count independent of the others.
For example, if label1 (Sec) hits 0, the label2 (Min) counter doesn´t decrease by 1. How can i sync them up?
Code:
Private Sub Timer1_Timer()
Dim lngDiffinSecs As Long
Dim lngTemp As Long
lngDiffinSecs = DateDiff("s", Now, "04/28/2005 10:30:00")
Label1 = lngDiffinSecs Mod 60 & " Sec" ' = "Rump" Secs
lngTemp = lngDiffinSecs / 60 ' Full Minutes
Label2 = lngTemp Mod 60 & " Min" ' "Rump" Mins
lngTemp = lngDiffinSecs / 3600 ' Full Hours
Label3 = lngTemp Mod 24 & " Hrs" ' "Rump" Hours
Label4 = Int(lngDiffinSecs / 86400) & " Days" ' Full Days
End Sub

Cheers!
Maverick



Edited by - Maverick2004 on 4/26/2005 1:45:28 AM

MessageBox
Does,anyone know how to change colour and text in MessageBox.

Many thanks Mark.

Messagebox
Is there any way to use your own captions in messagebox buttons, e.g. "Use", "Discard" instead of "Yes", "No".

Messagebox
i have a "on error goto error" in my program which displays a message box

error : msgbox "bla bla"

what i would like to know is when the userclicks on vbOk then i calls my function "clearfields"


cheers

MessageBox
how can i give a messagebox a title?


Code:
MsgBox("BlahBlah", Title???)

thanks

Messagebox
Hi, i want to make my custom messagebox with a form, i know how to do that and all but i want it to react like a messagebox. When a real messagebox pops up it disables everything elke untill you pressed ok, how can i do that with my form, when it pops up i want to let the user press "OK" first before it can continue with anything else.
thanx for any help.

API For Messagebox
This would be extremely helpful. I am making a batch printing/plotting utility for AutoCAD, the problem is I cannot suppress error dialogs, or dialogs with yes/no/etc. Is there a way to get button info for a like msgbox, or form, when it pops onto the screen, and programmatically click it? The problem I have is a number of plots being held up by one little dialog box, I need unattanded operation.Thanks

Messagebox Always Pop Up
I have problem here.. I want to query. When the textbox is null then I got the messagebox twice. Why?


Code:

Private Sub Text2_Change()
On Error GoTo error
databasepetatable 'connect record table peta menggunakan modul syskod
tablesys.Close
tablesys.Open "Select * from peta where Kod = '" & Text2.Text & "'", consys, adOpenDynamic, adLockOptimistic
If Not tablesys.BOF And Not tablesys.EOF Then
Text10.Text = tablesys.Fields("Peta").Value
Else
MsgBox ("Tiada Rekod dijumpai")
Text2.Text = ""
Text10.Text = ""
End If
error:
End Sub

Messagebox ..again!
I can't believe it! as im just learning vb all i seem to do is need help hehe. im sure this will be the last simple question for a while but here goes:


Code:
Dim Ans As VbMsgBoxResult
Ans = MsgBox("do you have credit? Click on the answer below. ", vbYesNo + _
vbQuestion + vbDefaultButton1 + vbSystemModal, "ReportR")

If Ans = vbYes Then
MsgBox "Are you calling a landline?", vbYesNo + vbQuestion + vbDefaultButton1, "Problem Solver"

Else

If Ans = vbNo Then
MsgBox "Is the person you wish to call using the same network?", vbYesNo + vbQuestion + vbDefaultButton1, "Problem Solver"

End If
End If


however, what i am trying to do is continue on from the latest message box and ask further questions (i've got another dozen or so to write) but i can't seem to do it or have the correct code. Is there a way or do i have to start from another command button again? so just in case that doesn't make sense..
when the messagebox 'Is the person you wish to call using the same network?' appears, am i able to generate another msgbox once the user has pressed either yes or no?

Yes To All, No To All Messagebox?
Is there some API or code in VB to pop up a message box that can offer "Yes to All, No to All" buttons similar to the way windows asks when moving a readonly file. Or maybe a checkbox that says "check to not ask again" without creating a custom form?

Messagebox Help
i want to have a messagebox with question saying

'are you sure you want to open this website'

with a yes/no box and i want the default input value to be

http://google.com

any help guys?

MessageBox
Can any body tell me how to display a messasge in a messagebox in multiple lines

MessageBox
I want a messagebox to pop up only when the user chooses and item from a listbox for the first time. How should I do that?

Messagebox Help
Is there a default "Yes,yes to all, no, no to all" message box in vb? I've searched the forum, but all I see are YesNo message box posts. Is there an API that can be used, or will this be a custom form (message box) that I'll need to create?

Messagebox
Ok the spacing didnt show up to distinguish the subitems so i'll try it again

Pizza
-----Small
-----Medium
-----Large
Soup
-----Clam Chowder
-----Cream of Mushroom
Salad
-----Caesar
-----Garden

like that without the dashes though

Messagebox Yes/No
How can i tell if yes or no was clicked, and add code to it?

MESSAGEBOX HELP
I need to prompt on screen more than one different msgbox at the same time without waiting the user click on its buttons.
When I send a msgbox the code wait the user click on it before go ahead.

How can I do it??? Please help me as soon as possible!!!

Many thanks

MessageBox
Hi,
   I use message box after every 1 minute, can i know programatically that msgbox has appeared.
Thanks in Advance
Aravind

On Timer Countdown
I'm doing an automated routine through macros. I have a form and I'm using the On Timer and Timer Interval properties to run the macro. I want to do 2 things:

1. Display a "countdown" on the form of how long it is until the routine runs again.

2. Display a label on the form that tells you when the last routine was performed.

How To Create A Countdown
Hi!!! I want to build an alarm that does something when the time expires.
for example: now it's 02:47:23 PM (in my country)
I'll set the hour when something happens to 03:00:00
well... how can I make the count down to that time? sth like this.:
xx hours xx minutes xx seconds left.. etc...




thanks in advance

simons

Display Countdown In Lbl
I just wanted to say first thanks for the people running this forum, its been an immense help to me for some time now.

I have a multi threading question, what I am doing is building a simple math application for my son that
will keep a record of how many he has right / wrong. For the multiplication form I want to create a timer that counts off, ( this timer will be adjustable, 5 seconds, 10 seconds, 15 seconds) I am using radio buttons for the timer options.

Now I want to display the timer in a label on the form, while my son is trying to figure out the answer. An while the timer is ticking from 5 to 1, 10 to 1, or 15 to 1, he would still have the ability to type in answer.

I have tried to few things as far as a timercontrol, but that did not give me what I wanted.

I know and am able to understand the concept of multi threading but am having trouble actually displaying the COUNTDOWN in a lable. Can anyone tell me the right direction I need to go thanks.

Mprybls

Countdown To Middnight?
just need a simple code that does hours, minutes, and seconds till midnight.

thanks!

Countdown Timer
How do i make a timer that counts down so when it reaches 0 a message popsup please?

Countdown Timer
For my application Im making I want to have a 10 count down timer before they can use some of the controls. This is the code im using.


Code:
Private Sub tmrCountdown_Timer()
Static Secs As Long

If Secs <= 0 Then Secs = 10
CountdownTime.Caption = "Please Wait: " & Secs & " Seconds"
Secs = Secs - 1
If Secs <= 0 Then
tmrCountdown.Enabled = False
cmdLogin.Visible = true
End If
End Sub
Now whats weird is its not showing me 0. Its stops at 1? Whats wronge with the code here? Also the interval on my timer is set to 1000 representing 1 second.

Countdown To A Date?
Ages ago, I made a small count down program to count down to my holiday!

The holiday date was added to the code and a time was used to count down the days, hours, mins and seconds to the holiday date. The countdown time was displayed in a label but its been ages since i last touched VB and its left my mind. Any help?

Countdown Timer
hey all,

have another two questions.
all of this for vb.

How do I code a text box to allow me to input a time like 2h30m20s and that in turn starts a timer that counts down to zero?

Also how do I code a box that will show that countdown's progress?

thanks for any help because I am trying to teach myself and have never had a basic programming class.

Schunn99

Countdown Action?
I am making a program that I need to call upon a certain sub every ##.## minutes.seconds, If anyone knows a simple way of doing this it would be greatly appritiated.

Countdown Timer
I am trying to finish an assignment but i am getting an error when i click on the set timer command button. could i please have an explanation as to what i am doing incorrectly.

code below -

Option Explicit
Dim StartTheClock As Integer, StopTheClock As Integer
Dim AddTime As Integer



Private Sub cmdSetTimer_Click()

Dim txtTime As Integer

'Set and show time.
If txtTime = "" Then
txtTimer = AddTime
End If
End Sub

Private Sub cmdStartTimer_Click()
'Start Timer
Timer1.Enabled = True
End Sub

Private Sub cmdStopTimer_Click()
'Stop Timer
Timer1.Enabled = False
End Sub

Private Sub HScroll_Change()
'Display in the text area adjusted by scroll method
txtTimer.Text = HScroll.Value
End Sub

Private Sub hscScroll_Scroll()
Call HScroll_Change
End Sub

Private Sub mnuAlarmClock_Click()
Me.Hide
frmAlarmClock.Show
End Sub

Private Sub mnuExit_Click()
End
End Sub

Private Sub mnuMainMenu_Click()
Me.Hide
frmMainMenu.Show
End Sub

Private Sub mnuStopwatch_Click()
Me.Hide
frmStopwatch.Show
End Sub

Private Sub Timer1_Timer()
Dim m_MSeconds As Single, m_Seconds As Single
Dim m_Minutes As Single

'Decrement the time.
m_MSeconds = m_MSeconds - 1
If m_MSeconds < 0 Then
If m_Minutes = 0 And m_Seconds = 0 Then
m_MSeconds = 0
Else
m_MSeconds = 9
m_Seconds = m_Seconds - 1
End If
End If
If m_Seconds < 0 Then
m_Minutes = m_Minutes - 1
m_Seconds = 59
End If
If m_Minutes < 0 Then m_Minutes = 0

End Sub

thank you

Time Only Countdown
I have a bunch of programs that make use of a long term countdown, as in counting down to an exact date and time (say 9am Christmas morning or 12am January 1st). I cannot seem to create one that does the same for just the time. The above programs count down the exact days, hours, minutes, and seconds until the event, but I want to create a program to count down the hours left in the current work day. I can do that now by manually adjusting the date everytime, but I know there has to be a way around that, using the date function to grab the time and manipulate it.
If you need a program, I can post it, but if you could just provide me with a time only snippet, it'd make things drastically easier.
Thanks in advance.

Countdown Timer
I am trying to display a countdown timer in seconds starting form a predetermined value.

ie i want to be able to countdown in seconds from 10 to 0

and just diplay the time in a text box or label.

I have been trying to use the timer control but it only increments and i want the opposite.

Countdown Time
how would i go about counting down the rest of the day showing hours, minutes and seconds.

thank you.
casey.

Countdown Timer
Here is the code of my program:

Form 1

Code:
Option Explicit

Private Sub cmdSet_Click()

Dim i As Integer
For i = 0 To 6

If txtTeacherQuestion(i).Text = "" Then
MsgBox "You must fill in all question boxes", vbOKOnly, "Error"
Exit Sub
Else
If txtTeacherAnswer(i).Text = "" Then
MsgBox "You must fill in all answer boxes", vbOKOnly, "Error"
Exit Sub

End If
End If
Next i
frmTeacher.Hide
frmPupil.Show
End Sub

Private Sub cmdTQuit_Click()
Unload Me
End
End Sub

Form 2

Code:
Option Explicit
Dim intCorrectAnswer As Integer

Private Sub cmdMark_Click()
Dim i As Integer
Dim e As Integer

For i = 0 To 6
For e = 0 To 6

If txtPupilAnswer(e).Text = "" Then
MsgBox "You must fill in all answer boxes", vbOKOnly, "Error"
Exit Sub
End If
Next e

If txtPupilAnswer(i).Text = frmTeacher.txtTeacherAnswer(i) Then
lblCorrect(i).Caption = "Correct"
Else
lblCorrect(i).Caption = "Incorrect"
End If
Next i
cmdMark.Visible = False
cmdMark2.Visible = True
End Sub

Private Sub cmdMark2_Click()
Dim i As Integer
For i = 0 To 6

If txtPupilAnswer(i).Text = "" Then
MsgBox "You must fill in all answer boxes", vbOKOnly, "Error"
Exit Sub
End If

If txtPupilAnswer(i).Text = frmTeacher.txtTeacherAnswer(i) Then
lblCorrect(i).Caption = "Correct"
intCorrectAnswer = intCorrectAnswer + 1
Else
lblCorrect(i).Caption = "Incorrect"
End If
txtPupilAnswer(i).Enabled = False
Next i

tmrAnswerCountdown.Enabled = False

If intCorrectAnswer = 7 Then
MsgBox "Well done, you go them all correct", vbOKOnly, "Hoorah"
End If

lblResults.Caption = "You scored " + CStr(intCorrectAnswer) + " out of 7"
cmdMark2.Enabled = False

End Sub

Private Sub cmdPQuit_Click()
Unload Me
End
End Sub

Private Sub cmdStart_Click()
subLoadQuestions
tmrAnswerCountdown.Enabled = True
tmrAnswerCountdown.Interval = 1000
cmdStart.Enabled = False
cmdMark.Enabled = True
Dim i As Integer
For i = 0 To 6
txtPupilAnswer(i).Enabled = True
Next i

End Sub

Private Sub Form_Load()
cmdMark.Enabled = False
tmrAnswerCountdown.Enabled = False
Dim i As Integer
For i = 0 To 6
lblQuestions(i).Caption = ""
txtPupilAnswer(i).Enabled = False
Next i

End Sub

Private Sub subLoadQuestions()
Dim i As Integer
For i = 0 To 6
lblQuestions(i).Caption = frmTeacher.txtTeacherQuestion(i).Text
Next i
End Sub

Private Sub tmrAnswerCountdown_Timer()
lblTimer.Caption = 1 - Time
End Sub

As you can see, on form 2 i want a timer to count down. I need it to count down from 10 mins and disable the buttons etc when the 10 mins is up.
Can anyone help?

Thanks

Ben.

Copyright 2005-08 www.BigResource.com, All rights reserved