Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

[RESOLVED] Doing Program Load Work on Separate Thread to allow Animated Splash Screen

$
0
0
Hi All,
I have a loading routine from my program where I need to read in large amounts of data from files, process that data and then finally load UI forms.

Currently I show a static splash screen while I'm running these loads on the UI thread. However, I'd like to load this data on a separate thread and show a progress bar that updates and shows animation (so the users don't think the program is stuck.)

I know I could run a background worker thread to do this work, but I'd like a little more control/structure (i.e. not having to do work, have handle an event to call a new sub routine, etc, just seems messy).

Is it at all possible to do the following? (mostly interested in how steps 3, 5 could execute but still allow UI animation to run)

Code:

* Pseudo code*

Main Program

1- Load Animated Splash Screen

2- Start parallel thread to load a file.

3- Wait here until parallel thread is complete *but* does not stall UI thread.

4- Start parallel thread to process files.

5- Wait here until parallel thread is complete *but* does not stall UI thread.

6- Close Animated Splash Screen

7- Open Main Form(s)

* End Pseudo code*

This just seems to have a better flow rather than the following:

Code:

* Pseudo code*

Main Program

1- Load Animated Splash Screen

2- Run back ground worker thread to do all work

*Event Background thread complete* - Loads UI forms

* End Pseudo code*

Any way to do this?

Thanks,
Nick

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>