timed labels and progressbar for major

ozzi guy

New member
Joined
May 29, 2010
Messages
4
Programming Experience
1-3
hi im new here and im in need of some help , im trying to make a short term ordering system for my major work for year 12 , i need to know how to run a timer in a label and progressbar at the same time , run by selections by combo boxes in another form
 
You don't run a Timer "in" anything. A Timer simply runs or doesn't. If it's running, i.e. its Enabled property is True, then it raises Tick events. What you do in the Tick event handler is up to you. You can update a ProgressBar and a label and a hundred other controls if you want.

If you're still not sure what to do, please provide a more detailed description of exactly what you want to happen.
 
ok , i want a set amount of seconds for the timer to disply in a label ( so like a count down that is varied) when selecteditems in a combo box('s) are selected , example of code of the top of my head :

If order1.SelectedItem = "1 x coke" Then
central.opt1_1.Text = "1 x coke"
central.price1_1.Text = "$2"
End If
(where as order1 is the combobox in form 1 , central being form 2 , opt1_1 being a label and price1_1 being the second label both in central) now from that i want to add progressbar values in each ".selecteditem" and make a timer in central count down according to what is selected ,
 
tutorial (aloschi productions )

ok , if you can go to this link where i have made a tutorial for my project ( if it looks amature , it is cause this just a school thing , not a pro thing ) note i havent set up dload link as of now so dont click it, the thing i want to happen is on label 4 on last image , thats where i want a count down timer , see the labels left of it , depending on whats in thoes eight labels will ditermine the time in the countdown and the progressbar ( btw this is a bump for great justice , thx in advanced
 
I still have no idea what relationship the four Labels have to the rest but maybe that's not important anyway. Basically, you need to use a Timer. Each time the Timer raises a Tick event, you do something. What that something is is up to you. You can increment a variable, update your ProgressBar, update your Label and/or whatever else you want to do. You can also test a condition if you want and stop the Timer if that condition is met.
 
ok if you go back to the two last images in the site tutorial , see how it says "1x burger . 1 x chips . 1 x coke etc " on both ( in the combo boxes in the second last image and on the labels to the left in the last image) i want on label 4 on last image to display 5:00 and count down to 0 once i hit "yes" on the form in the second last image , it just shows the user an estimated time for completion . is that more simpler?
 
Here are the approximate steps you'll have to follow to get what you want.
set a public variable with a value of 300 (number of seconds in 5:00 minutes)
Add a timer to your project if you haven't already.
disable the timer. Set it's interval to 1000 (1 second)
Double click on the timer to access the tick event.
On each tick event, subtract 1 from your variable that started at 300.
This will give you the number of seconds left in the order
if you want to update a progress bar add one to your project with a minimum of 0 and a maximum of 100, update it by using the equation 300 - your public variable /3
convert the number of seconds left back to minutes and seconds. and display in your label.
When the user clicks order, enable your timer.
when the timer reaches 0, disable the timer and set your variable back to 300.
 
Back
Top