Results 1 to 9 of 9

Thread: [SOLVED]Thread message when all threads finished

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    10

    [SOLVED]Thread message when all threads finished

    Okey I wrote simple code like this->
    csharp Code:
    1. Thread[] ts=new Thread[10];
    2.  
    3. for(int i=0;i<10;i++)
    4. {
    5. ts[i]=new Thread(function);
    6. ts[i].IsBackground = true;
    7. ts[i].Start();
    8. }

    So my threads are doing some work in background... but I need some kind of MessageBox when all threads stops working... I don`t mean .Join() because it blocks the main thread which is form application...

    I tried making another function to check background if ThreadState is stopped... but it doesn`t work...

    Is there any way to show that MessageBox when all are stoppped(not on button stopped-aborted) ?
    and I can`t change to threadpool or tasks....
    Last edited by globus25; Jan 28th, 2012 at 04:11 PM. Reason: SOLVED

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