Solved

splash screen while program running

Posted on 2004-09-22
4
161 Views
Last Modified: 2010-05-02
I have a program shows a splash screen while the program is running in the background.

The problem is the splash screen is greyed out  most of the time the program is running.  Why?

thanks
0
Comment
Question by:running32
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Erick37
Comment Utility
If your background process is performing tasks in a loop, then your splash form will not receive events from the system and appear hung.
Placing a DoEvents statement in the loop of your background process should resolve the problem.  DoEvents will allow the system to "service" your splash screen.

Hope it helps
0
 
LVL 5

Expert Comment

by:KarcOrigin
Comment Utility
Try this:

Public Sub Main()
  SplashScreen.Show
  Doevents
  Load MainScreen
  MainScreen.Show
End Sub

In the MainScreen form's Activate event write this:

Private Sub MainScreen_Activate()
  Unload SplashScreen
  Set SplashScreen = Nothing
End Sub

Cheers!
0
 
LVL 1

Expert Comment

by:crjor
Comment Utility
My code will look something like this

Sub Main
0
 
LVL 1

Accepted Solution

by:
crjor earned 125 total points
Comment Utility
Try this:

Public Sub Main()
  frmSplash.Show vbModal
  Doevents
  frmMain.Show vbModal
End Sub

Public Function Initialize() as Boolean
  Initialize = False
 ' Your initialization code here
 ...

  Initialize = True
End Function

In the Splash Screen form's Activate event write this:

Private Sub frmSplash_Activate()
  While Initialize = False
     Doevents
  Wend
  Unload Me
End Sub

cya!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

12 Experts available now in Live!

Get 1:1 Help Now