VB.NET Report Progress on StreamWriter write


I have sucessfully implemented the backgroundworker / report progress on a number of tasks by updating the report progress within a loop.

However, when I am writing to a text file from a Rich Text Box, I cannot report progress because I am not looping through the records (because this takes too long).

Instead I am using the following code:

Dim objwriter As New StreamWriter(Filename)


Open in new window

How do I report progress without going through a loop and writing line by line?
Who is Participating?
Mike TomlinsonMiddle School Assistant TeacherCommented:
Since you're not looping and the Write() method doesn't report any feedback, you can't.

You can change the cursor to an hourglass or display an animated gif so the user knows something is happening.
Luis PérezSoftware Architect in .NetCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.