Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

New Instance of Image

Hi,
In one of my forms (vb5) i have file box which contains list of different images. i want to display all the images in small thumbnail format.  I have created 1 image control and for every image in the listbox i want to create a new instance of image control.
How?
thanks in adv.
ps: pls give me declarations and usage i.e., small piece of code.  thanks aganin
0
msali
Asked:
msali
  • 3
  • 2
1 Solution
 
watyCommented:
Do as follow :
nMaxImages contains the current number of images loaded

 nMaxImages = nMaxImages + 1
 Load Image(nMaxImages)
 Image(nMaxImages).Picture = LoadPicture(...)

0
 
msaliAuthor Commented:
Its not working ... I get an error of "Type mismatch" at the line where it says
Load Image(10)
.
in ;your answer u said and i quote
"nMaxImages contains the current number of images loaded"
where are the images loaded--- i don't get it..
thanks.







0
 
watyCommented:
nMaxImages indicates the actual number of instances of images in memory.
0
 
msaliAuthor Commented:
and in the last line u say
 Image(nMaxImages).Picture = LoadPicture(...)
- do i load picture in a loop.

msa.
0
 
watyCommented:
This means that you load the picture from a file into the lastest image control you have created.

You can do this in a loop

 for nI = 1 to 10
   nMaxImages = nMaxImages + 1
   Load Image(nMaxImages)
   Image(nMaxImages).Picture = LoadPicture("Image" & Cstr(nI) & ".bmp")
 next

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now