Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splash Page

Status
Not open for further replies.

awesomebeats

Technical User
Nov 29, 2001
25
US
Hello, i have a splash page in my program. that has some simple animation. pictures move and explode to the toolbar. but I was wondering how to make it so that if someone presses Enter, then it will skip to the end of the animation?

This is what is going on with it right now....should i just add an if statement? and how do i do that to skip it to the end?


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

Dim xDestination As Integer = Me.tbRightSide.Left
Dim yDestination As Integer = 0

bTargetReached = False

'The Explosion

'The Shrink-n-Move
Select Case iAnimatingImageIndex
Case Is = 0
yDestination = Me.tbRightSide.Top
Case Is = 1
yDestination = Me.tbRightSide.Top + 50
Case Is = 2
yDestination = Me.tbRightSide.Top + 100
Case Is = 3
yDestination = Me.tbRightSide.Top + 200
End Select
If Me.PictureBox1.Height > 50 Then Me.PictureBox1.Height = Me.PictureBox1.Height - 3
If Me.PictureBox1.Width > 50 Then Me.PictureBox1.Width = Me.PictureBox1.Width - 3
If Me.PictureBox1.Top >= yDestination Then Me.PictureBox1.Top = Me.PictureBox1.Top - 2
If Me.PictureBox1.Left <= xDestination Then Me.PictureBox1.Left = Me.PictureBox1.Left + 8
If Me.PictureBox1.Top <= yDestination And Me.PictureBox1.Left >= xDestination Then
bTargetReached = True
End If


'Reset and move to next image
If bTargetReached = True Then

Me.Timer1.Stop()

Me.PictureBox1.Height = 250
Me.PictureBox1.Width = 250
Me.PictureBox1.Top = 150
Me.PictureBox1.Left = 270

Select Case iAnimatingImageIndex
Case Is = 0
iAnimatingImageIndex = 1
bTargetReached = True

'Show TB Button
Dim toolBarButton0 As New ToolBarButton
Me.tbRightSide.ImageList = Me.ilRightTBImages
toolBarButton0.ImageIndex = 0
' Add the new toolbar button to the toolbar.
Me.tbRightSide.Buttons.Add(toolBarButton0)
toolBarButton0.ToolTipText = "Calculate Monthly Payments and Closing Costs"


Case Is = 1
iAnimatingImageIndex = 2
bTargetReached = True

Dim toolBarButton1 As New ToolBarButton
Me.tbRightSide.ImageList = Me.ilRightTBImages
toolBarButton1.ImageIndex = 1
' Add the new toolbar button to the toolbar.
Me.tbRightSide.Buttons.Add(toolBarButton1)
toolBarButton1.ToolTipText = "The 1003 Form"

Case Is = 2
iAnimatingImageIndex = 3
bTargetReached = True

Dim toolBarButton2 As New ToolBarButton
Me.tbRightSide.ImageList = Me.ilRightTBImages
toolBarButton2.ImageIndex = 2
' Add the new toolbar button to the toolbar.
Me.tbRightSide.Buttons.Add(toolBarButton2)
toolBarButton2.ToolTipText = "The Address Book"

Case Else
Dim toolBarButton3 As New ToolBarButton
Me.tbRightSide.ImageList = Me.ilRightTBImages
toolBarButton3.ImageIndex = 3
' Add the new toolbar button to the toolbar.
Me.tbRightSide.Buttons.Add(toolBarButton3)
toolBarButton3.ToolTipText = "All the forms, disclosures and reports"

iAnimatingImageIndex = 10
Me.Timer1.Stop()
Me.PictureBox1.Visible = False
Me.Timer1.Enabled = False
Me.Timer1.Stop()

'Flag so the Paint event of the main form wont call us anymore
bAnimationComplete = True
Me.tbRightSide.ShowToolTips = True
lblPicture1Label.Visible = False
End Select

End If

End Sub
 
hi! thanks for all your cool code :)

no acutaly what you probably need to do is look for the keypress event of the form... and if the key is ascii(13) ??
then disable the timer and clear the form..
and run your last case...

one thought (without thinking about it too carefully)

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top