Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import a Photo Folder into VB6

Status
Not open for further replies.

BadCook

Technical User
Sep 7, 2009
71
US
I have a Photo Folder in my C drive called Ichthus
What command can I put in my code that imediatly opens that folder either when the VB6 program starts or when a command button is clicked?
The VB6 program is also in the C drive, so is a App.Path statement required?
Thanks for any help.
 
Explain please.

Are you wanting to "import" the folder contents as resources for the application buttons or backgrounds etc?

Or are you simply creating a photo gallery application?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Chris
Thanks for your responce.
I want the pictures displayed, perhaps as thumbnails, so I can click on any of them for further action.
 
Ok so you can do with the what the trend has been for several years now and keep tha data away from the application the issue there is you may need to read the registry hives to get the location of the users common data folders ("My Documents", "My Pictures" etc.) with the application running from "Program Files".

Or, as you suggest you can have the data in a subfolder of the application folder (Windows 3.1 style) in which case app.path + "/datafolder/ will do fine.

If it is a completely self contained/standalone app, where the data is not going to be used by other applications.

However if other apps are likely to be accessing, moving, deleting or otherwise processing the data, using the user folder locations is the right way.
This also applies if the application is to be multi-user capable, with each user having their own data collection(s).


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
>you may need to read the registry hives to get the location of the users common data folders

No, you don't. You can get those locations quite easily without examining the registry, e.g add a reference to Microsoft Shell Controls and Automation, and then try this code:
Code:
[blue]    With New Shell32.Shell
        MsgBox .NameSpace(ssfMYPICTURES).Self.Path
    End With[/blue]

 
strongm
THanks for your response.
I am not familiar with the Shell method you used but it sounds like it would do what I want.
Would you please give me rhe specific code required.
To repeat, By clicking a command button I would like to inport and open a file containing nothing but photos. The file could be located on the C drive along with the program.
I've tried various combinations of commands but can't get anything to work.
 
Getting (and enumerating) a folder (any folder) is the easy bit. Displaying them, "perhaps as thumbnails, so [you] can click on any of them for further action" is harder - particularly since you don't really seem sure exactly what it is you want to do.

Perhaps you could refine your requirements somewhat and come back to us. Please note, however, that tek-tips is not a code-writing service ...

 
What I want to do is this:
I would like to click a command button on a form that would import and show the photos in a Foto File. Clicking on a photo in that file would then open a box containing information about the person shown, new information, or information that can be changed.
This is for a Sunday School class that would like to record ita members.
I'm having trouble with the first part, importing the Foto File.
Any help will be appreciated.
 
and what is a Foto File?

Is that someting created by another application?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Sorry,
I should have said File Folder.
This Folder contains the pictures of all the individuals involved.
 
Ok, what you need to do is,

On the button click use the link ]FileSystem Object[/url] to read the image file names in a folder, and pass them to a ImageList, then when an image is selected, you pass the image path to a Picture Box

The imahelist and picture controls are created at "runtime" using the parameters read from the image count for the list and the image type and size for the picture box.
You can of course create these controls at design time and have them hidden/inactive until they are needed but that tends to "bloat" the application unnecessarily.




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top