I need to show a screen or something, saying ‘Loading’ or whatever while long process are working.
I am creating a application with the Windows Media Encoder SDK and it takes awhile to initialize the encoder. I would like for a screen to pop up saying ‘Loading’ while it is starting the encoder, and then for it to disappear when the encoder is done and they can continue with the application.
Any help would be appreciated. Thanks!
Create a Form that will serve as the ‘Loading’ dialog. When you’re ready to initialize the encoder, display this form using the
ShowDialog()method. This causes it to stop the user from interacting with the form that is showing the loading dialog.The loading dialog should be coded in such a way that when it loads, it uses a
BackgroundWorkerto initialize the encoder on a separate thread. This ensures the loading dialog will remain responsive. Here’s an example of what the dialog form might look like:And, when you’re ready to display the dialog, you would do so like this:
There are more elegant implementations and better practices to follow, but this is the simplest.