Results 1 to 10 of 10

Thread: Help me to do this

  1. #1

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    Unhappy 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]

  2. #2
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: Help me to do this

    Search web for

    Browse For Folder Dialog

    Good Luck

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    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?

  5. #5

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    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

  6. #6
    New Member
    Join Date
    Mar 2009
    Location
    Nairobi, Kenya
    Posts
    6

    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:
    1. Dim FSO as New Scripting.FileSystemObject
    2. DIm x as file
    3. Dim FilePath as string
    4. FilePath = 'The path of the image
    5. x = FSO.GetFile(FilePath)
    6. msgbox x.FileName

  7. #7

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    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.

  8. #8

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    Re: Help me to do this

    Quote 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:
    1. Dim FSO as New Scripting.FileSystemObject
    2. DIm x as file
    3. Dim FilePath as string
    4. FilePath = 'The path of the image
    5. x = FSO.GetFile(FilePath)
    6. 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

  9. #9
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    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

  10. #10
    New Member
    Join Date
    Mar 2009
    Location
    Nairobi, Kenya
    Posts
    6

    Re: Help me to do this

    Quote Originally Posted by bloodsside14 View Post
    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
  •  



Click Here to Expand Forum to Full Width