Solved

splash screen while program running

Posted on 2004-09-22
4
163 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
ID: 12127678
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
ID: 12130134
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
ID: 12130810
My code will look something like this

Sub Main
0
 
LVL 1

Accepted Solution

by:
crjor earned 125 total points
ID: 12130864
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

776 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