|
-
Mar 15th, 2009, 09:24 PM
#1
Thread Starter
Fanatic Member
Help me to do this
Hi guys! i am new here and i need some help for my system and i am using Visual Basic 6.0. Is there any one help me how to do this
[img=http://img16.imageshack.us/img16/1818/vb6.th.png]
-
Mar 15th, 2009, 10:09 PM
#2
Frenzied Member
Re: Help me to do this
Search web for
Browse For Folder Dialog
Good Luck
-
Mar 15th, 2009, 10:20 PM
#3
Re: Help me to do this
Welcome to the forums.
SHBrowseForFolder is definitely one solution to get a user-navigated folder.
Another option (from your img) is to use the common dialog, have user select any file and then strip the path name from the common dialog's FileName property.
If either of the above are used, you will have to use Dir$() function, in a loop, to return all the files in the selected folder.
Yet antoher option is to place a DriveCombo control, DirList control & FileList control on your form. Using the three together is a long-about way of doing one of the other two, but you don't need much code. A beginner's solution.
And there are other solutions too, of varying difficulty
-
Mar 15th, 2009, 11:22 PM
#4
Thread Starter
Fanatic Member
Re: Help me to do this
I almost done with my project and my only problem is this .
I need to view the image file in a list view.. or thumb nail.. but i think its better list view Only the file name of the image will show. you know what i mean if u select the list view in the folder of your computer how can i do that?
-
Mar 15th, 2009, 11:50 PM
#5
Thread Starter
Fanatic Member
Re: Help me to do this
and another problems guys when i copy the file in to the folder if the file is existing then create a folder where the file will be put all existing files.
need help badly asap! thx
-
Mar 16th, 2009, 01:11 AM
#6
New Member
Re: Help me to do this
Open the project references, then select microsoft Scripting Runtime.
This is the code to get only the filename:
vb Code:
Dim FSO as New Scripting.FileSystemObject
DIm x as file
Dim FilePath as string
FilePath = 'The path of the image
x = FSO.GetFile(FilePath)
msgbox x.FileName
-
Mar 16th, 2009, 01:29 AM
#7
Thread Starter
Fanatic Member
Re: Help me to do this
Open the project references, then select microsoft Scripting Runtime.
josh please explain this how to do this.. i am not so familiar on that so please explain it to me how to configure that.
-
Mar 16th, 2009, 01:45 AM
#8
Thread Starter
Fanatic Member
Re: Help me to do this
 Originally Posted by josh.rice
Open the project references, then select microsoft Scripting Runtime.
This is the code to get only the filename:
vb Code:
Dim FSO as New Scripting.FileSystemObject
DIm x as file
Dim FilePath as string
FilePath = 'The path of the image
x = FSO.GetFile(FilePath)
msgbox x.FileName
disregard my 1st reply.. i already see it and i check it and press ok.
where do i put taht code to try your code
-
Mar 16th, 2009, 11:23 AM
#9
Frenzied Member
Re: Help me to do this
Okay, I'm bumping this because OP PM'd me and it took a couple of reads but the OP's last problem is...
How to display thumbnails of images in listview control.
Add an image list to your form.
Select your listview control
Select Custom in the properties box
GoTo second tab "Image Lists"
In the combo box to the right of "Normal" select the image list you just added.
Hit OK
Now start a new project>Add a listview (name it LV), Add an imagelist (Name it IL), Add commandbutton, and Size LV so you can see images, then add code below.
Code:
Option Explicit
Private Sub Command1_Click()
IL.ImageHeight = 100
IL.ImageWidth = 100
IL.ListImages.Add 1, "1.jpg", LoadPicture("c:\z\pb\1.jpg", vbLPCustom, vbLPColor, 100, 100)
IL.ListImages.Add 2, "2.jpg", LoadPicture("c:\z\pb\2.jpg", vbLPCustom, vbLPColor, 100, 100)
IL.ListImages.Add 3, "3.jpg", LoadPicture("c:\z\pb\3.jpg", vbLPCustom, vbLPColor, 100, 100)
IL.ListImages.Add 4, "4.jpg", LoadPicture("c:\z\pb\4.jpg", vbLPCustom, vbLPColor, 100, 100)
LV.ListItems.Add 1, "1.jpg", "1.jpg", 1
LV.ListItems.Add 2, "2.jpg", "2.jpg", 2
LV.ListItems.Add 3, "3.jpg", "3.jpg", 3
LV.ListItems.Add 4, "4.jpg", "4.jpg", 4
End Sub
Now what you will need to do is to replace my "1.jpg" (1-4) with your image file names and in the loadpicture function you need to replace my file paths to your file paths.
Then run, click on commandbutton
Good Luck
-
Mar 17th, 2009, 01:57 AM
#10
New Member
Re: Help me to do this
 Originally Posted by bloodsside14
Open the project references, then select microsoft Scripting Runtime.
josh please explain this how to do this.. i am not so familiar on that so please explain it to me how to configure that.
OK.
Start a new project
Click project on the menu, and at the bottom of the list you will see 'project1 references.'
Then in the dialog that appears, scroll down until you see 'Microsoft Scripting Runtime.' Check it, then click on OK.
Then now add the code i specified:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|