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]
Printable View
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]
Search web for
Browse For Folder Dialog
Good Luck
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
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:D 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?
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 :(
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
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.
disregard my 1st reply.. i already see it and i check it and press ok.Quote:
Originally Posted by josh.rice
where do i put taht code to try your code
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.
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.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
Then run, click on commandbutton
Good Luck
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: