Night Posted May 9, 2003 Posted May 9, 2003 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 ;) Quote
hog Posted May 9, 2003 Posted May 9, 2003 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 Quote My website
Leaders Squirm Posted May 9, 2003 Leaders Posted May 9, 2003 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. Quote Search the forums | Still IRCing | Be nice
hog Posted May 9, 2003 Posted May 9, 2003 Point taken, but I've never experienced the situation you mention, each to his own I suppose? Quote My website
Cassio Posted May 9, 2003 Posted May 9, 2003 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. Quote Stream of Consciousness (My blog)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.