beaconlightboy
asked on
VB.net app screen does not refresh
i wrote and application which that reads thru my server event logs. the log files can be large and i have a progress bar on a statusbar.
the text in the status bar will update itself when told to, for instance ["now reading record ## of ##"] but the statusbar will not increment. even when i force a refresh of it. also, when i minimize the app, and then bring it backup, the statusbar text refuses to even update anymore.
how do i fix this?
the text in the status bar will update itself when told to, for instance ["now reading record ## of ##"] but the statusbar will not increment. even when i force a refresh of it. also, when i minimize the app, and then bring it backup, the statusbar text refuses to even update anymore.
how do i fix this?
ASKER
i was researching threads, but wasnt sure how to update the gui when using one. when i set on up it just ran the code and said it was done, even though i know it wasnt.
So you need a simple example of how to set up a thread and update the main GUI from it?
ASKER
that would be great.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The simple solution is to add this line:
Application.DoEvents()
inside your loop to allow your app to process its messages and update accordingly.
The "correct" solution though would be to move your processing into another thread so that your main UI interface does not get locked up. This is more complex though is you need to use Delegates to marshal the call from your thread back onto the main UI thread. Let me know if you want to go that route...