By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

can u help about the code in vb6.0 between 1minute and 2 minute

P: 84
this is my vb6.0

combo1 combo2

and a two listbox

the 1st listbox had a text.

then the secong one If I run the project I will type the text that has written in the 1st listbox.

In my combo 2 it has two choices. 1minute and 2minute.

if i will click the 1 minute, then it will stop . then when you click the 2minute. it has debug.

can u help on my problem?
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo1_Change()
  2. List2.Clear
  3. If Combo1.ListIndex = 0 Then
  4.     List2.AddItem "Present and surrender the coupon at mercury drug stores and avail of discount of partcipating products."
  5. Else
  6.     List2.AddItem "aicel"
  7. End If
  8. List2.AddItem "maricel"
  9. End Sub
  10.  
  11. Private Sub Combo1_Click()
  12. List2.Clear
  13. If Combo1.ListIndex = 0 Then
  14.     List2.AddItem "Present and surrender the coupon at mercury drug stores and avail of discount of partcipating products."
  15. Else
  16.     List2.AddItem "aicel"
  17. End If
  18. List2.AddItem "maricel"
  19. End Sub
  20.  
  21. Private Sub Combo2_Change()
  22. If Combo2.ListIndex = 0 Then
  23.     Timer1.Interval = 60000
  24. Else
  25.     Timer1.Interval = 120000
  26. End If
  27. End Sub
  28.  
  29. Private Sub Combo2_Click()
  30. If Combo2.ListIndex = 0 Then
  31.     Timer1.Interval = 60000
  32. Else
  33.     Timer1.Interval = 120000
  34. End If
  35. End Sub
  36. Private Sub Timer1_Timer()
  37. Form2.Show
  38. End Sub
Apr 22 '08 #1
Share this Question
Share on Google+
6 Replies


debasisdas
Expert 5K+
P: 8,127
What are you trying to do with this code ?

Is the time control enabled ?
Apr 22 '08 #2

smartchap
100+
P: 236
There is nothing wrong with the above code. But what is in Form2, List1, etc. What exactly you want to do and what is your problem. Please explain in detail with the full code so that we may help.
Apr 22 '08 #3

zerok666
P: 25
it could be the coding for the timers. this is how i usually code the timers or ill get a bunch of errors:

Dim countr As String

Private Sub Form_Load()
Timer1.Interval = 1
countr = "0"
End Sub

Private Sub Timer1_Timer()
If countr >= 120000 Then
'your code here for when it reaches 2 min
End If
If countr >= 60000 Then
'your code here for when it reaches one min
End If

countr = countr + 1
End Sub
Apr 23 '08 #4

lotus18
100+
P: 866
it could be the coding for the timers. this is how i usually code the timers or ill get a bunch of errors:
Expand|Select|Wrap|Line Numbers
  1. Dim countr As String
  2.  
  3. Private Sub Form_Load()
  4. Timer1.Interval = 1
  5. countr = "0"
  6. End Sub
  7.  
  8. Private Sub Timer1_Timer()
  9. If countr >= 120000 Then
  10. 'your code here for when it reaches 2 min
  11. End If
  12. If countr >= 60000 Then
  13. 'your code here for when it reaches one min
  14. End If
  15.  
  16. countr = countr + 1
  17. End Sub
  18.  
if you declared countr as string then you cannot add a value to the countr

Rey Sean
Apr 23 '08 #5

zerok666
P: 25
in vb6, you can declare it as a string and add to it. i use this in all of my programs and it never fails me.
Apr 24 '08 #6

lotus18
100+
P: 866
in vb6, you can declare it as a string and add to it. i use this in all of my programs and it never fails me.
Of course you can but it is not really a good practice. String and Numbers are not the same.

Rey Sean
Apr 24 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.