I'm writing a program in VB. When the program loads, I have to put some code in Form_Load to be processed. After that, an audio file should be played to show that the program is ready to work.
My problem is that I can't know when the previous lines in the Form_Load have finished processing to be able to start playing an audio file.
Imagine that you have to do large arithmetic calculations in Form_Load to allow the program be ready. Many programs put a Splash screen to let the user know that the program has been started and make him/her wait for some time.
If I hide my form when it starts and show it in the last line of Form_Load, that doesn't solve the problem either.
My problem is this:
1. How to show a form named "frmSplash" immediately when my application starts and let the main form of the application "frmMain" be processed in the background?
2. When "frmMain" finishes processing, how can I know that it's finished processing to hide or Unload "frmSplash" and turn "frmMain" to visible?
I don't know how to use DoEvents. Can anyone help me solve this problem?
Thank you in advance.
My problem is that I can't know when the previous lines in the Form_Load have finished processing to be able to start playing an audio file.
Imagine that you have to do large arithmetic calculations in Form_Load to allow the program be ready. Many programs put a Splash screen to let the user know that the program has been started and make him/her wait for some time.
If I hide my form when it starts and show it in the last line of Form_Load, that doesn't solve the problem either.
My problem is this:
1. How to show a form named "frmSplash" immediately when my application starts and let the main form of the application "frmMain" be processed in the background?
2. When "frmMain" finishes processing, how can I know that it's finished processing to hide or Unload "frmSplash" and turn "frmMain" to visible?
I don't know how to use DoEvents. Can anyone help me solve this problem?
Thank you in advance.
Comment