Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Make splash form may sound easy but its not.

I need a loading form that can:

- Display on screen as a modal form to prevent user from interacting with UI when the program is busy (load something - it take time)

- When display that form, we're still able to run loading code

- That form can be close any time

- May be in the future: display progress bar on the loading form

 

I've tried some thread things and also meet a lot of thread bugs ;)

Posted

This is how I make my Splash form work

 

Set the startup form of your solution to be your splash form.

 

Set a timer on your splash form to the desired delay

 

Have this code on the splash form timertick event

 

Replace frmMain with the name of your main application form

 


Private Sub tmrSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSplash.Tick

Dim frmNewMain As New frmMain()

Me.tmrSplash.Enabled = False

Me.Hide()

frmNewMain.Show()

End Sub

 

some say don't use a timer, but I have always done it this way and have never come across any problems as yet in doing so

My website
  • Leaders
Posted

The reason people will recommend against a timer is it will usually cause the splash screen to be displayed for either too long or not long enough, both of which we want to avoid. The general procedure you should be using would be:

 

Show splash form
Load program objects
Hide splash form

 

To add a progressbar, you would update it after each individual program item has been successfully initialised.

Posted
I guess there is no problem using a timer in a splash screen, cause some times we want to display it for a determinated amount of time, so the user can read whats written. I would use the Squirm methods to show status forms.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...