First, thank you for your replys.
Here is the code for creating the controls. Please be kind, I am not that proficient in VB but here it is.
I basically search a folder that has the pictures and then create appropriate picture boxes and load them with the image.
I have it in the Form_Load
Dim ctlname as vb.picturebox
Dim l as integer
Dim lfilename as string, lpic as picture
Dim pfolder as string, pextension as string, pwidth as long, pheight as long, pscalemode as long
pfolder = app.path & "\pictures\"
pextenstion = "*.jpg"
pwidth = 1000
pheight = 1000
getfilecount "path to pictures"
s = 0
l = 1000
do while s <> x
l = s * 1000
Set stlname = Form1.controls.add("vb.picturebox", "Pict" & s, Form1)
ctlname.visible = true
ctlname.width = 1000
ctlname.move 1, ctlname.width, 1000, 1000
s - s + 1
with ctlname
.borderstyle = 0
.width = ctlname.scalex(pwidth, pscalemode, ctlname.parent.scalemode)
.height = ctlname.scalex(pheight, pscalemode, ctlname.parent.scalemode)
.autoredraw = true
.scalemode = pscalemode
end with
lfilename = dir(pfolder & pextension)
Do while lfilename <> ""
set lpic = loadpicture(pfolder & lfilename)
ctlname.paintpicture lpic, 0, 0, pwidth, pheight
lfilename = Dir
if lfilename <> "" then
if s <> x then
exit do
end if
loop
Thanks
Keith Kelly