VB.NET Report Progress on StreamWriter write

Posted on 2012-09-17
Last Modified: 2012-09-20

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?
Question by:mondintator
    LVL 25

    Expert Comment

    by:Luis Pérez
    LVL 85

    Accepted Solution

    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.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now