Results 1 to 11 of 11
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    Multi-threading = Timer no work!

    Whenever I activate a timer in a multi-thread like this

    Code:
    Timer1.Enabled = true
    The timer does not activate.

    When I don't put it in a multi-thread it works.

    How can I fix?
    My Unbelievable-Kill BM:
    seeplusplus - updating address
    [YOUTUBE]nWgztMVIUYY[/YOUTUBE]

  2. #2
    willrulz188's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Ohio?
    Posts
    1,786
    Reputation
    35
    Thanks
    231
    My Mood
    Amazed
    Ummmmm timer1.start() ..........................
    Question ALL statements! ?
    You're in denial that you're in denial. ?
    [img]https://i360.photobucke*****m/albums/oo45/blood188/Untitled-3.jpg?t=1284590977[/img]

  3. #3
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    Still doesn't work.
    My Unbelievable-Kill BM:
    seeplusplus - updating address
    [YOUTUBE]nWgztMVIUYY[/YOUTUBE]

  4. #4
    willrulz188's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Ohio?
    Posts
    1,786
    Reputation
    35
    Thanks
    231
    My Mood
    Amazed
    Quote Originally Posted by ppl2pass View Post
    Still doesn't work.
    Check your code in your timer it could be wrong or wrongly done

    Whats your timer code?

    Edit: you have to activate the timer you know

    like add a button and double click on it and type timer1.start()

    then when you click on the button you activate it


    this is HIGHLY simple..............
    Last edited by willrulz188; 11-20-2010 at 01:29 PM.
    Question ALL statements! ?
    You're in denial that you're in denial. ?
    [img]https://i360.photobucke*****m/albums/oo45/blood188/Untitled-3.jpg?t=1284590977[/img]

  5. #5
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    Quote Originally Posted by willrulz188 View Post
    Check your code in your timer it could be wrong or wrongly done

    Whats your timer code?
    MsgBox("Hi")

    But it doesnt pop up Hi.
    My Unbelievable-Kill BM:
    seeplusplus - updating address
    [YOUTUBE]nWgztMVIUYY[/YOUTUBE]

  6. #6
    willrulz188's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Ohio?
    Posts
    1,786
    Reputation
    35
    Thanks
    231
    My Mood
    Amazed
    Quote Originally Posted by ppl2pass View Post
    MsgBox("Hi")

    But it doesnt pop up Hi.
    if you use a timer for that you will get a unlimited amount of messages aka you will have to restart to stop it

    try just adding a button double clicking and typing msgbox("HI")
    Question ALL statements! ?
    You're in denial that you're in denial. ?
    [img]https://i360.photobucke*****m/albums/oo45/blood188/Untitled-3.jpg?t=1284590977[/img]

  7. #7
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Show us your full code.



  8. The Following 2 Users Say Thank You to Blubb1337 For This Useful Post:

    Hawky1337 (11-29-2010),willrulz188 (11-20-2010)

  9. #8
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    We can't do much if we don't know your code, I agree with Blubb.

    Please post your code

  10. #9
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Meh, use System.timers.Timer

    within the .net framework, the system timer will create a new thread to
    handle the elapsed event


    Code:
    Dim WithEvents Timer1 As New System.Timers.Timer
    
    
    Private Sub Timer1_Tick() Handles Timer1.Elapsed
    ' Your code here, whatever it is
    End Sub
    System.Windows.Forms.Timer will tick on the the same thread as the
    form, It isn't true multi threading.

    Read the MSDN article

    https://msdn.microsof*****m/en-us/magazine/cc164015.aspx



    Last edited by NextGen1; 11-20-2010 at 04:07 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  11. #10
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    In case you've not read over your post before submitting, there's practically NO useful information in there for us to make deductions from.

  12. #11
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    I disagree, he used the words

    Timer1.enabled = true and Multithreading in the same sentence.

    There is a issue right there.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  13. The Following User Says Thank You to NextGen1 For This Useful Post:

    Lolland (11-20-2010)