Results 1 to 2 of 2

Thread: slide transition in vb

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    1

    slide transition in vb

    I have two pictures and i want a picture box to start at the first picture and push right until the second picture fills up the picture box. i cannot use powerpoint because i do not have it installed on my computer. how would you recommend that I do this?

    john g

  2. #2
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: slide transition in vb

    Maybe as 1 possible solution. Place both pic boxes inside a panel and set their correct height and size but have pic1 ahead of Pic2. Then with a timer update their location property so that it appears they are scrolling. When picbox2's location (x) position gets to where you want it to be - disable the timer.

    You will have to play around with the settings of the timer and the location but it should work quite well.
    vb Code:
    1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    2.     Handles Timer1.Tick
    3.  
    4.         If Not Me.PictureBox2.Location.X >= 300 Then  'set to the correct value
    5.             Me.PictureBox1.Location = New Point(Me.PictureBox1.Location.X + 20, Me.PictureBox1.Location.Y)
    6.             Me.PictureBox2.Location = New Point(Me.PictureBox2.Location.X + 20, Me.PictureBox2.Location.Y)
    7.  
    8.         Else
    9.             Timer1.Enabled = False
    10.         End If
    11.  
    12.     End Sub
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width