Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

New Instance of Image

Posted on 1998-08-25
5
Medium Priority
?
154 Views
Last Modified: 2010-04-30
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
Comment
Question by:msali
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
waty earned 100 total points
ID: 1430850
Do as follow :
nMaxImages contains the current number of images loaded

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

0
 

Author Comment

by:msali
ID: 1430851
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
 
LVL 14

Expert Comment

by:waty
ID: 1430852
nMaxImages indicates the actual number of instances of images in memory.
0
 

Author Comment

by:msali
ID: 1430853
and in the last line u say
 Image(nMaxImages).Picture = LoadPicture(...)
- do i load picture in a loop.

msa.
0
 
LVL 14

Expert Comment

by:waty
ID: 1430854
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question