Solved

New Instance of Image

Posted on 1998-08-25
5
144 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 50 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

777 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