Hello,
I'm relatively new to VB and I'm having trouble with some (what should be simple) code. This code is just me, trying to teach myself ways to do things, and maybe there'll be a practical application in the future. I'm using VB 6.0 on a Windows XP platform.
Ok, the code is:
Option Explicit
Dim inc As Integer
Sub form_load()
Dim objPics(1 To 7) As String
' Load bitmaps into the Picture object array.
objPics(1) = "C:\VBstuff\test\pic1.bmp"
objPics(2) = "C:\VBstuff\test\pic2.bmp"
objPics(3) = "C:\VBstuff\test\pic3.bmp"
objPics(4) = "C:\VBstuff\test\pic4.bmp"
objPics(5) = "C:\VBstuff\test\pic5.bmp"
objPics(6) = "C:\VBstuff\test\pic6.bmp"
objPics(7) = "C:\VBstuff\test\pic7.bmp"
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
inc = 1
If inc < 3 Then
Picture1.Picture = LoadPicture(objPics(inc))
inc = inc + 1
Else
Timer1.Enabled = False
End If
End Sub
What I get is:
Compile Error
Sub or Function not defined
Picture1.Picture = LoadPicture(objPics(inc))
objPics gets highlighted.
How can I get it to see that it's an array and not a function?
Thanks in advance,
Mark