Solved

New Instance of Image

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now