Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a splash screen that has an exit timer that closes the form after 8 seconds, is there a way to put a progress bar on the splash screen that shows the progress of the exit timer?
Whenever, wherever, whatever
Posted

Something like:

   Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

       Static iIterations As Integer = 0

       iIterations += 1

       If iIterations = 8 Then Me.Close()

   End Sub

Here's what I'm up to.
Posted

VB:

--------------------------------------------------------------------------------

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

 

Static iIterations As Integer = 0

 

iIterations += 1

 

If iIterations = 8 Then Me.Close()

 

End Sub

 

 

How does that tie into the progress bar? Do I have to declare a variable for the progress bar before entering the code above? Also instead of 1 and 8, should it be 1000 and 8000 since the timer uses milliseconds?

Whenever, wherever, whatever
  • *Experts*
Posted

Set the Max property of your ProgressBar to 8, then set the Value of your ProgressBar to iIterations each time the Timer goes through.

 

However, I really hate programs which unnecessarily prolong splash screens, so I recommend against that very strongly.

Posted
I don't want to sound like a dummy, but how do I set the value of my progressbar to iIterations? Also what are iIterations? (I can change the length of the splash screen, 8 seconds was just for testing purposes, I was thinking along the lines of 4 0r 5 seconds for the splash screen)
Whenever, wherever, whatever
  • *Experts*
Posted

Value is a property of the progress bar. iIterations is the variable given in Machaira's sample code.

 

Also, I wouldn't even recommend using a splash screen if you don't need them. They are only used to indicate progress when loading a large program. 9 times out of 10, one is not needed.

Posted
Have to agree with Volte here. The only time I can see using a splash screen with a hard-coded display time would be for shareware apps. When the user registers the app, the splash screen isn't displayed.
Here's what I'm up to.

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...