Results 1 to 7 of 7

Thread: DoEvents or what

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    DoEvents or what

    I think doevents isnt here anymore, but that's not my question:
    I have a button in my form and when it is clicked, the program will try to run a big for loop which takes a few minutes to finish. I tried to put a cancel button so that the users would be able to cancel the process if they want. But the thing is that the form is not being updated when the loop is running and so the cancel button wont get the click event...
    I'm just asking for a solution to this....
    tnx for any help

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    System.Windows.Forms.Application.DoEvents()

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by PT Exorcist
    System.Windows.Forms.Application.DoEvents()
    umm would it be a good thing to put a doevent in the loop? I think it slows down the process too much
    I'll try to use that, but just wondering if anyone knows any better way to do this...

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    you may want to to put the process into a new thread is probably preferable.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm so how do I do that?

    dim t as new thread (addressOf mySub)
    t.start

    ???


    and btw nice grammer cander

  6. #6
    hellswraith
    Guest
    I just posted a link about multithreading in VB.NET....
    Here is the thread on the forums where I posted the link...
    http://www.vbforums.com/showthread.p...hreadid=187201

  7. #7

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    tnx

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