de4thpr00f
Nov 21 2007, 02:15 PM
Hello, i'm having some troubles creating a countdown, i'm willing for some help. First of all, the form has a textbox where the user has to input the time to countdown like this: 1:10 < this means 1 minute and 10 seconds the form has also 3 labels, 1 named countminutes, other countseconds and another label1 with the text ":" here's the code, the problem is that it counts the time, but blocks the app till it ends, wich result on not showing the counttime like it should: CODE Imports System.Threading.Thread
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim time() As String time = Split(timetowait.Text, ":", , CompareMethod.Text) countminutes.Text = time(0) countseconds.Text = time(1) Dim minutes As Integer = time(0) Dim seconds As Integer = time(1) start: If seconds = 0 And minutes = 0 Then GoTo stops End If If seconds = 0 Then minutes -= 1 seconds = 60 End If seconds -= 1 countminutes.Text = minutes countseconds.Text = seconds Sleep(1000) GoTo start stops: MsgBox("countdown off") End Sub End Class If someone could help me would be cool. If i pull this out before someone helps me i'll post the new code in here. Thanks in advance. ~ Joćo Lopes *edit* Posted the attached file. *edit* Problem solved, i'll leave the 1st source there and attach another, the 1st source has nothing important, but uses the function sleep, and i don't know if it will not be needed around. and the code is this one (note, now a timer is needed, named timer1) CODE Imports System.Threading.Thread
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If InStr(timetowait.Text, ":") Then Dim time() As String time = Split(timetowait.Text, ":", , CompareMethod.Text) countminutes.Text = time(0) countseconds.Text = time(1) Timer1.Interval = 1000 Timer1.Start() Else MsgBox("You have to insert like this 1:10") End If End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim minutes As Integer = countminutes.Text Dim seconds As Integer = countseconds.Text If minutes = 0 And seconds = 0 Then MsgBox("Time Ended") Timer1.Stop() End If If seconds = 0 Then minutes -= 1 seconds += 60 End If seconds -= 1 If minutes <> -1 Then countminutes.Text = minutes countseconds.Text = seconds End If End Sub End Class
Reply
paulbacca
Jan 7 2008, 08:46 AM
Hi de4thpr00f, would you know how to add hours to your code below. I would appreciate any help you can give. Thanks Paul [quote name='de4thpr00f' date='Nov 21 2007, 02:15 PM' post='358108'] CODE Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim time() As String time = Split(timetowait.Text, ":", , CompareMethod.Text) countminutes.Text = time(0) countseconds.Text = time(1) Dim minutes As Integer = time(0) Dim seconds As Integer = time(1) start: If seconds = 0 And minutes = 0 Then GoTo stops End If If seconds = 0 Then minutes -= 1 seconds = 60 End If seconds -= 1 countminutes.Text = minutes countseconds.Text = seconds Sleep(1000) GoTo start stops: MsgBox("countdown off") End Sub End Class
Reply
imbibe
Jan 10 2008, 07:16 AM
You can convert hours to seconds and add them to the code. BTW for timer there's inbuilt control for Desktop & Web (using ASP.NET AJAX 1.0) Applications. Set the Interval property to seconds, minutes, even hours, days. Then handle the Tick Event.
Reply
Similar Topics
Keywords : , vb, net, 2k5, countdown, countdown, visual, basic, 2005, 2k5
- Reavolution
Intense Visual Gratification (1)
Ti Basic: Pick A Number
(0) Description Learn how to create a neat-o Game in TI Basic. Its basic premise is that someone
picks a number, then they pass the calculator to their friend, and they try to guess the number.
Once the successfully guess the number a message appears and says that they have won. I have also
included a line that keeps users from choosing numbers greater than one-hundred. Please Enjoy.
Try I Out Alright.... just input what you see below and I'll explain it a little below.
CODE :ClrHome :Lbl 2 :Prompt A :A->X :If X>100 :Goto 2 ....
Visual Wd Is The Poorest Attempt Of Programming Yet
Microsoft has let them selves down (0) Well for starters, the installer says it all. It took me 75 mins to install and i got a 4 CPU 3.5
gHz processor, the images still have their magenta background and they look like its been drawn on
paint. You go make an application but you dicide its rubbish - so you delete it, and unlike Basic
and C# your project is still listed with no images and the link is broken, so it just wastes space.
The sqldb's aren't editable - you can just view them THERE ISNT A BUTTON TO PLACE A DIV
IN!!! You click on a panel and the properties dont appear I went to ....
Aob Blood Grouping
Few Basic Idea for all (0) AOB blood grouping is the most common blood grouping in present world. In this grouping blood
grouped depending on presence and absence of antigen A and antigen B in blood. Blood groups in AOB
system are A, B, AB and O. I am trying to explain this blood grouping system as easy as possible so
that the member of this site who has no science background can also understand the system. If any
blood contain antigen A but no antigen B, the blood group will be A blood group. If any blood
contains antigen B but no antigen A, the blood group will be B blood group. If any blood co....
Ti-basic --- Slot Machine
(5) Description Ok, so this is my first TI-BASIC tutorial. In this tutorial you will learn how to
create a very simple slot machine, so you can entertain yourself in math class /tongue.gif"
style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> You will need at least a TI
83 Calculator. Try it out Ok, first create a new program called 'SLOT MACHINE'. Hit the
enter key. Now input the following code. CODE :ClrHome :Lbl 1
:Output(1,1,"--Slot Machine--") :Output(2,1,randInt(0,9,1))
:Output....
Some Basic But Important Info About Cancer
(1) Symptoms of Cancer 1. Lumps, especially those that are growing larger gradually, appearing on parts
of your body such as the breasts, neck abdomen. 2. Signs of injury not externally inflicted which
do not go away after a long time, such as bruises and scratches on the skin or ulcers on the tongue
3. Body weight keeps fluctuating or nutrition level decreases dramatically (e.g. falling sick more
frequently or feel tired easily) despite the absence of sicknesses that also cause such symptoms
such as Diabetes. 4. Dry cough that does not heal in a long while, blood in phl....
Photoshop Tut: Basic Text (video)
(0) Same thing as my sig tut, but for text. http://youtube.com/watch?v=SDFfVDSBhrY ....
Photoshop Tut: Basic Sig (video)
(0) This tutorial is for BEGINNERS who want to make a basic signature. And yeah I know, I have a weird
squeaky voice :3 http://youtube.com/watch?v=9HE0C15uP80 ....
Ftp In Vb 2005
badly needed! (0) Hello, i was wondering real badly. Does anybody know how to make an FTP browser or uploader in
Visual Basic 2005 (also in 2008 - but they are the same) because i am making an add-on for my
webbrowser. Or atleast can they send me a link. But please do not send me a link and tell me to
search it - i've given up searching for 2005. Many many thanks if someone's found one for
me. Rep++++....
Ftp In Visual Basic 6.0
Start making your FTP client using VB6 (0) Recently, I had a need to make a FTP client, since our webhosting FTP server was kind of exotic, and
very restrictive, and most of uploads, even though they reach 100% would crash... File would be
uploaded to a server, but FTP clients just froze upon completion, waiting for the 226 (OK) from FTP
server... So, I had to make my own, one who would not wait for 226, but instead, watch the file
pload progress... This tutorial is not fuly complete, in the sense that it does not offer COMPLETE
FTP client functionality (for example, I ddn't write the code for FTP download, ....
Two Really Good 2d Mmo Engines
One is pretty basic, the other one is for top notch programmers. (1) AlterEngine MMO engine that lets you edit and create a new world. Just run the server and
distribute the game client, it's simple to use and effective for non commercial MMOs. It's
mother language is spanish, so unless you know spanish, I wouldn't recommend this. This Engine
doesn't require much Programming Experience. vbGORE Great MMO Engine, very powerful. Runs
with VB6, fully editable. It's free and open source. It can achieve great things if you have the
time and potential to script neat VB6 functions with Packet related coding and knowledg....
Countdown Timer
(0) Hi all, Can you help me with the script below. I found this code on a old posting. I would like to
able too input a value for hours and have that countdown also. Thanks Paul Private Sub
Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim hours As Integer = countminutes.Text Dim minutes As Integer = countminutes.Text
Dim seconds As Integer = countseconds.Text If hours = 0 And minutes = 0 And seconds = 0 Then
'MsgBox("Time Ended") Timer1.Stop() End If ....
Help! Php Or Just Html?
i want to start buliding my website. which is better, php or basic htm (6) i try to start this topic in webhost category but it seems like i cant. i dont have the permission
so i just post my topic here. im sorry mod.. i want to build a website which contains: - Links to
videos - Informations - photos - flash i don't know if i should use php or just HTML. guys,
what are your opinions..??....
Mysql In Visual Basic
Mysql in visual basic (5) I'm am trying to create a script so that visual basic 6 can interact with mysql Any ideas?....
Learn Russian
Basic Stuff You Need To Know (7) Learning Russia Lesson 1 - Basic Words ~~~~~~ Hello - privyet (informal hello) Hello - zdrastye
(formal hello) Bye - poka How are you - kak dila Good/Wll - horosho Ok/Normal - normalno Poor/Bad -
Ploka ---More Words Yet To Come--- ---Study Makes Perfect--- I am going to make a quiz over this
so you all better be ready =). I hope I inspire you to learn russian. Its a great language plus I am
russian as a russian respects mother russia we respect all so I am sharing top language (not really
top) to you. L = Lesson Quiz - Over L1 http://www.quizyourfriends.com/quizp....
Ea Sports Cricket 2005
A COOL GAME (14) THIS IS BETTER THAN EA'S CRICKET 2004 GARANTEED I HAVE BEEN PLAYING IT FOR A LONG TIME `IF
ANY BODY WANTS THIS ADD A REPLY ILL UPLOAD IT TO RAPIDSHARE.DE DUDE, this isn't COOL. Read our
forum rules and know why you're getting this note and how illegal it is to break copyright laws.
....
Creating A Timer Program
Using Visual Basic 2005 (8) This tutorial will explain how to create a basic timer using Visual Basic Express 2005. If you
don't have it, it's free and you can dowload it from Microsoft's website. All you need
is a few minutes to sit down and read this and a version of Visual Basic. OK, so what will this
timer actually do? Well, you are able to enter a number of minutes and a message, and then click a
button. Once the timer is up, your message pops up and you are reminded! So, basically it's
a little reminder system. I use it to remind me when TV programmes start, when I have to....
Simple C File Handling In Action
Small code snipet which covers most of basic file handling and navigat (2) Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
formalities to get the code review incorporated and update all source code files with code review
headers. Imagine if you need to open 300 files one by one and append code review headers at the
end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
utility to open all files passed on command line and open attach code review headers an....
My First C++ Program
very basic (6) Okay, well today I've started learning C++ and after about 30 minutes I've managed to
compile my first program /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
alt="smile.gif" /> All it does is prompt you to type a number in between 1 and 10. If it's not
in that range, it adds/subtracts until it is. The best part is you get to see it add/subtract the
numbers up one-by-one! Code: #include using namespace std; int main() {
// Define variables int anumber; cout cin>> anumber; cin.ignore....
How To Make A Web Browser
Visual Basic 6 (47) This is a simple and specific tutorial on how to make a basic web browser in Visual Basic 6. Steps
1-3 Create a new project, and then go to "Project" on the menu. Click components as shown in the
following image. Find the component "Microsoft Internet Controls," check it, and click "Apply" and
then "Close." Click the icon that was just added in the tools window, and draw a large sized
window with it. This is going to be where you view webpages through your browser, so don't make
it small, but leave room for buttons and other accessories. Steps 4-6 Make a t....
Visual Basic 6.0 Help Needed
Adding lines to a textbox without delete (11) I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
Help is appreciated!....
Java Basic Program Guidance
(6) aving some problems taking in the Java at Uni, Was wondering if anyone could shine some light on it
for me. My task is to write a program that will ask you to enter 2 words. the program will then
print out both words on one line. However the words will be seperated by dots that will make the
total length of the line 40. so if your first word was turtle and the second was abc, the output
would be turtle...............................abc The program should check for certain conditions:
1. a word can not be longer than 37 characters; 2. there must always be atlest 2 do....
Heard Of Oled?
latest visual technology (13) Hey guys have you heard about OLED? Organic Light-Emitting Diode (OLED) technology An OLED is
an electronic device made by placing a series of organic thin films between two conductors. When
electrical current is applied, a bright light is emitted. This process is called
electrophosphorescence. Even with the layered system, these systems are very thin, usually less than
500 nm (0.5 thousandths of a millimeter). When used to produce displays, OLED technology
produces self-luminous displays that do not require backlighting. These properties result in thin,
very ....
Simple Login In Visual Basic 6
user interaction example trough login programm (5) First of all, I am NOT a programmer, this is something my friend taught me. It describes basic
interaction with the user, while showing basic functionality of this simple programm. So, without
further ado, we're off to the tutorial: First of all, start your visual basic, when prompted
for new project, select Standard Exe . Next, we need to open code window, so we can start typing
the program. This can be done in two ways, one is double clicking on the form, or selecting Code
from View menu. If you double clicked on the form, you will see following text: CODE ....
Delphi 2005 + Mysql
how to connect mysql with delphi 2005? (2) Anyone knows how to connect mysql with delphi 2005? Thanks! /smile.gif' border='0'
style='vertical-align:middle' alt='smile.gif' /> ....
Fifa 2005
(13) ok i just got this game and the graphics really suck! i bought it for ps1 but it still works in
ps2. the graphics are realy bad you can't even see the players faces.. is the game like that or
maybe is it because its for ps1? also is fifa 2004 better than 2005?....
[tutorial] Visual Basic 6 Minimize To Tray
Minimize to Tray (3) This example will "minimize" your program to the system tray when you click on a button, and restore
it when you click the system tray icon. For this example you'll need: 1 Form - Form1 1 button -
Command1 Add a Module to your project, and ad this code: CODE ' Create an Icon in System
Tray Needs Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long
uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const WM_MOUSEMOVE ....
[tutorial] Visual Basic 6
Closing Programs Right, Why END is bad (1) This tutorial applies to all those people who insist upon using "End" to close their programs: End
stops the program immediately without any thought as to what's going on - it's like a high
speed train hitting a brick wall. It can cause unwanted errors and is bad programming practice in
general. END gets rids of the form, but NOT its leftovers. This leaves a bunch of memory that will
still be in use even after your program has supposedly closed. An object or variable won't be
terminated properly - it's just not a graceful exit. The only time that it'....
Need Help With My Python Programs
just extremely basic stuff (10) ok, i am learning python, and i realy dont know much. my guide im using said to make a program
where it asks your name, and if the name is yours your make it so there is a compliment, if it is
another name you make it that its an insult, and anything else makes it say Nice name. here is what
i wrote name = raw_input("What is your name?") if name == John: print "Your name is freaking
sweet, you must be a god or something." elif name == Bob: print "You have a freakin' weird
name, dude." else: print "Nice name,",name i donot understand what i am doing w....
Football Manager 2005
(14) I am really surprised that thetre is no thread for this fantastic game.This is simply the best
managerial simulation of football ever.So many teams,so many tactical possibilities,very good match
engine.I think that you can manage teams from more than 50 countries,including some very exotic-like
Hong Kong for example! Also,there are numerous graphical add-ons for this game,like face
packs,skins,logo packs,etc. You MUST try it out as soon as possible!!! Fantastic
game!....
Looking for , vb, net, 2k5, countdown, countdown, visual, basic, 2005, 2k5
|
|
Searching Video's for , vb, net, 2k5, countdown, countdown, visual, basic, 2005, 2k5
|
advertisement
|
|