Results 1 to 15 of 15

Thread: Illiad vs. VB6.0 (who's retarded?)

Threaded View

  1. #1

    Thread Starter
    Addicted Member Illiad's Avatar
    Join Date
    Mar 2003
    Location
    Chicago
    Posts
    196

    Illiad vs. VB6.0 (who's retarded?)

    I don't get this at all! I'm making a program that "Locks" windows for a defined period of time. I have 3 settings. Setting 1 is to lockdown for a certain ammount of time. Setting 2 is to lock permanently. Setting 3 is to restart once the timer is completed. That's where the problem is! In setting 3's Subroutine...
    Heres a fragment of the code...

    VB Code:
    1. Private Sub Timer1_Timer()
    2. BlockInput True
    3. If lbltime.Caption > 0 Then
    4.     lbltime.Caption = lbltime.Caption - 1
    5. Else
    6.     lbltime.Enabled = False
    7.     BlockInput False
    8.     Sleep 800
    9.     Unload frmLocked
    10.     Unload frmWinLock
    11.     Timer1.Enabled = False
    12.     End
    13. End If
    14. End Sub
    15. Private Sub Timer2_Timer()
    16. BlockInput True
    17. lbltime.Caption = "++++"
    18. If lbltime.ForeColor = &H80000012 Then
    19.     lbltime.ForeColor = &HE0E0E0
    20. Else
    21.     lbltime.ForeColor = &H80000012
    22. End If
    23. End Sub
    24. Private Sub Timer3_Timer()
    25. BlockInput True
    26. If lbltime.Caption > 0 Then
    27.     lbltime.Caption = lbltime.Caption - 1
    28. Else
    29.     lbltime.Enabled = False
    30.     BlockInput False
    31.     Sleep 800
    32.     Unload frmLocked
    33.     Unload frmWinLock
    34.     Timer1.Enabled = False
    35.     End
    36. End If
    37. End Sub
    The settings are represented by timers (e.g. setting 1 is timer1 and so on)
    Whenver I run the program on setting 3 I get this error message "Runtime Error Type 13, Type Mismatch" on the "If lbltime.Caption > 0 Then" line on timer3. However, as you may see above, the code for timer1 and timer3 are the same. I know that timer3 won't restart windows cauz I havent augmented its code yet. But VB only gets the error on timer3...whats going on?!

    Note: lbltime.caption is set by a variable "seconds", "seconds" is a public integer.
    Last edited by Illiad; Mar 27th, 2003 at 12:26 AM.
    Quis Custodiet Ipsos Custodes?

    You don't have to be faster than the bear, you just have to be faster than the slowest person running from the bear.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width