I’d like to make 5 to 10 (or more) new instances of canvas1 “on the fly”
I have a canvas1 on the form.
My first line is:
dim MyNewerCanvas(10) As new canvas1
… a little confused here as sometimes I read that “new” is required and sometimes that “new” isn’t required.
The code goes on …
dim x as integer
dim x2 as integer
Dim f As FolderItem
for x = 0 to 10
MyNewerCanvas(x).top = 100 + x2
MyNewerCanvas(x).Left = 199 + x2
x2 = x2 + 100
f = GetFolderItem(“C:\Users\Philip\Desktop\Angela School\Level 0\pictures lesson 1/Im_sad.jpg”, FolderItem.PathTypeShell)
If f.Exists Then
mypic = picture.open(f)
mynewercanvas(x).invalidate
Else
MsgBox(“The FolderItem does not exist.”)
End If
next x
One error I’m getting is nilexceptionerror
another is
expected class windows1.canvas1 but got windows1.canvas1
But do I now call on C for each of the pictures I want to load on to it?
So c(0), c(1) etc.?
I thought I would have to call the “new canvas” as new canvas1() because that has the paint command in it.
Dim f As FolderItem
For i As Integer = 0 To 5
Dim c As Canvas = New Canvas1()
f = GetFolderItem(“C:\Users\Philip\Desktop\Angela School\Level 0\pictures lesson 1/Im_sad.jpg”, FolderItem.PathTypeShell)
If f.Exists Then
mypic = picture.open(f)
c(i).top = i * 100
Else
MsgBox(“The FolderItem does not exist.”)
End If
To further add to it, if these canvas’ are going to overlap, at all, and you plan on running this on Windows you’ll be sorely disappointed at the flicker.