Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 14-02-2009, 06:36 PM   #1 (permalink)
In The Zone
 
arian29's Avatar
 
Join Date: Feb 2008
Location: New Delhi
Posts: 212
Default need help in this code (vb6)


can someone please assist me with the code. its not working.

'------------------------countdown timer Code-----------------------------------
Option Explicit

Private m_StopTime As Date

Private Sub cmdGo_Click()
Dim fields() As String
Dim hours As Long
Dim minutes As Long
Dim seconds As Long

fields = Split(txtDuration.Text, ":")
hours = fields(0)
minutes = fields(1)
seconds = fields(2)

m_StopTime = Now
m_StopTime = DateAdd("h", hours, m_StopTime)
m_StopTime = DateAdd("n", minutes, m_StopTime)
m_StopTime = DateAdd("s", seconds, m_StopTime)

tmrWait.Enabled = True

End Sub '>> it stops here dosent go to Sub tmrWait_Timer()


Private Sub tmrWait_Timer()

Dim time_now As Date
Dim hours As Long
Dim minutes As Long
Dim seconds As Long

time_now = Now
If time_now >= m_StopTime Then
MsgBox ("ok")
tmrWait.Enabled = False
lblRemaining.Caption = "0:00:00"
Else
seconds = DateDiff("s", time_now, m_StopTime)
minutes = seconds \ 60
seconds = seconds - minutes * 60
hours = minutes \ 60
minutes = minutes - hours * 60

lblRemaining.Caption = _
Format$(hours) & ":" & _
Format$(minutes, "00") & ":" & _
Format$(seconds, "00")
End If
End Sub
arian29 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 06-03-2009, 12:50 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2008
Posts: 2
Default Re: need help in this code (vb6)

you should define interval time for timer control try that
priyank80 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What code is this.. REY619 Programming 7 13-08-2008 03:29 PM
lock code..not security code magneticme200 Mobiles and Tablets 3 29-12-2007 07:15 PM
Need a code... Ron QnA (read only) 4 17-12-2006 01:42 AM
Bar Code desertwind QnA (read only) 4 23-07-2005 02:02 PM
.exe to code CompaqVijay QnA (read only) 5 27-02-2005 04:39 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2