Results 1 to 3 of 3

Thread: Wait for process

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Fenton,Mo.
    Posts
    15

    Wait for process

    I am looping system.diagnostics.process.start this code works when I put a break in the code and single step it thru waiting for each line to finish. but if I don't use a break or step it thru quickly the process I am trying to start doesn't have a chance to finish the first time around before it loops and is ready to start again. Is there a way to make it wait for a process before moving on to the next?

    Dim ProgramsSelected As Int16
    Dim count As Int16 = 0
    ProgramsSelected = newProgramList.SelectedItems.Count
    Do
    count += 1
    System.Diagnostics.Process.Start _(newProgramList.SelectedItem)
    newProgramList.SetSelected _(newProgramList.SelectedIndex, False)
    Loop Until count = ProgramsSelected

    Dale

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Try putting in Application.DoEvents()

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Fenton,Mo.
    Posts
    15
    I couldnt get that to work. Am I useing it correct?



    ProgramsSelected = newProgramList.SelectedItems.Count
    Do
    count += 1
    System.Diagnostics.Process.Start(newProgramList.SelectedItem)
    Application.DoEvents()
    newProgramList.SetSelected(newProgramList.SelectedIndex, False)
    Loop Until count = ProgramsSelected


    Dale

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