timer/progress bar on splash screen

G

Guest

Hi,
When my app starts, it reads in a few text files. During this processing I
would like to display a progress bar. However when I put the call to do the
processing in the startup form's load event, the form is not yet visible, so
no progress bar. I assume the processing code needs to go in another place.
But how to call it? Do I need a timer? Do I need a "Main"?
Thanks,
John
 
J

Jon Brunson

Mankow said:
Hi,
When my app starts, it reads in a few text files. During this processing I
would like to display a progress bar. However when I put the call to do the
processing in the startup form's load event, the form is not yet visible, so
no progress bar. I assume the processing code needs to go in another place.
But how to call it? Do I need a timer? Do I need a "Main"?
Thanks,
John

This is the way we do it, put this method in any class (we call ours
EntryPoint) and set up the project to run this method as the startup object

[VB.NET]

Public Shared Sub Main()

Dim frmSplash As New Forms.SplashScreen
frmSplash.Show()

Try
' load youre files here

Catch ex As Exception
frmSplash.Close()
MessageBox.Show(ex.Message, "Error Loading", MessageBoxButtons.OK,
MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return

End Try

' initialize the main form BEFORE closing the splash screen
Dim frmMain As New Forms.Main
frmSplash.Close()

Application.Run(frmMain)

End Sub
 
G

Guest

Hi Jon,
I tried your technique...couple of questions
Dim frmSplash As New Forms.SplashScreen
The compiler does not recognize Forms.SplashScreen, so I did this instead:
Dim frmSplash as New Form

I stepped throught the code, when this line executes
frmSplash.Show()
the splash screen does not show.
the rest of the program continues on, and my main screen launches.
Is there a particular property I need to set on the splash screen form?
Thanks,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top