Solved

New Instance of Image

Posted on 1998-08-25
5
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

628 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