Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Monday, July 11, 2011

VB-36 : Slide Show

Create a form with a picture-box. Find 3 interesting pictures and use a time control to cycle these 3 pictures every one second.Place an exit button to close the application..

A)    Program Design : 

(B) Property(Controls Used) :
  1.       Command Button - CAPTION- Exit
  2.       Timer                         - INTERVAL - 1000
  3.       Picture Box             -  PICTURE - none

(C) Attaching Code to the Object :

Dim Pictures() As String
Dim i As Integer
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Pictures(0) = "c:\My Documents\My Pictures\Sample Pictures\Blue hills.JPEG"
Pictures(1) = "c:\My Documents\My Pictures\Sample Pictures\Sunset.JPEG"
Pictures(2) = "c:\My Documents\My Pictures\Sample Pictures\Water lilies.JPEG"
i = 0
End Sub
Private Sub Timer1_Timer()
Index = i Mod 3
Picture1.Picture = LoadPicture(Pictures(Index))
i = i + 1
End Sub



Error in Output as "Subscript out of range"

      • ====================================================================
        Back to Home   &  VB
    ===========================================================

    No comments: