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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • czi02
    New Member
    • Sep 2006
    • 84

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

    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?
    [code=vb]
    Private Sub Combo1_Change()
    List2.Clear
    If Combo1.ListInde x = 0 Then
    List2.AddItem "Present and surrender the coupon at mercury drug stores and avail of discount of partcipating products."
    Else
    List2.AddItem "aicel"
    End If
    List2.AddItem "maricel"
    End Sub

    Private Sub Combo1_Click()
    List2.Clear
    If Combo1.ListInde x = 0 Then
    List2.AddItem "Present and surrender the coupon at mercury drug stores and avail of discount of partcipating products."
    Else
    List2.AddItem "aicel"
    End If
    List2.AddItem "maricel"
    End Sub

    Private Sub Combo2_Change()
    If Combo2.ListInde x = 0 Then
    Timer1.Interval = 60000
    Else
    Timer1.Interval = 120000
    End If
    End Sub

    Private Sub Combo2_Click()
    If Combo2.ListInde x = 0 Then
    Timer1.Interval = 60000
    Else
    Timer1.Interval = 120000
    End If
    End Sub
    Private Sub Timer1_Timer()
    Form2.Show
    End Sub[/code]
    Last edited by debasisdas; Apr 22 '08, 08:14 AM. Reason: added code=vb tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What are you trying to do with this code ?

    Is the time control enabled ?

    Comment

    • smartchap
      New Member
      • Dec 2007
      • 236

      #3
      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.

      Comment

      • zerok666
        New Member
        • Apr 2008
        • 25

        #4
        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

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Originally posted by zerok666
          it could be the coding for the timers. this is how i usually code the timers or ill get a bunch of errors:
          [code=vb]
          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
          [/code]
          if you declared countr as string then you cannot add a value to the countr

          Rey Sean

          Comment

          • zerok666
            New Member
            • Apr 2008
            • 25

            #6
            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.

            Comment

            • lotus18
              Contributor
              • Nov 2007
              • 865

              #7
              Originally posted by zerok666
              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

              Comment

              Working...