|
-
Oct 1st, 2000, 07:25 PM
#1
Thread Starter
New Member
Open "C:\PicView\Collections\FastLoadExp.txt" For Input As #1
j1 = 0
Do Until EOF(1) = True
Input #1, s1
ReDim Preserve pic(j1 + 1)
Set pic(j1) = New Picture1
pic(j1).Picture = LoadPicture(s1)
pic(j1).Visible = False
...
question:
why would the SET, NEW statements create an arror like
"user defined type not defined" ?
the pic() variable is a global that is of type PictureBox
-
Oct 1st, 2000, 07:33 PM
#2
If you create the Picturebox as a Control Array (Set the controls Index property to Zero) then you can add to it at runtime, i.e.[CODE]Private Sub Command1_Click()
Dim iFile As Integer
Dim sFile As String
iFile = FreeFile
Open "C:\PicView\Collections\FastLoadExp.txt" For Input #iFile
While Not EOF(iFile)
Input #iFile, sFile
Load Pictureboxes(Pictureboxes.Count)
With Pictureboxes(Pictureboxes.Count - 1)
.Visible = True
.Move .Width * .Count, 0
.Picture = LoadPicture(sFile)
End With
Wend
Close iFile
End Sub[CODE]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|