views:

51

answers:

3

Hi.

I am creating an application.and i am scanning files of a drive to search a particular pattern my progress bar is getting updated and at the end all the file names are listed in the list box.i want the all those files to be listed immediately as soon as its found that they contain the pattern.

I'm using BackgroundWorker

+5  A: 

Use the ReportProgress method in combination with the ProgressChanged event. This type of scenario is exactly what they are intended for.

Fredrik Mörk
+3  A: 

You can use ReportProgress method of background worker.

http://msdn.microsoft.com/en-us/library/a3zbdb1t.aspx

Alex Reitbort
A: 

You would need to implement a foreground worker and invoke it from the background worker.

Ideally, you would be passing a list of any newly found files to the foreground worker.

Gunner