Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. browse

browse

Scheduled Pinned Locked Moved Visual Basic
csharplinuxtestingtools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hesham Amin
    wrote on last edited by
    #1

    Hi.. I wish to share a small VB6 problem.. I want to display hte BrowseForFolder Dialog so the user can select a folder.. so I did this : add a reference to shell32.dll (or Microsoft Shell controls and Automation) the code : Option Explicit Dim sh As New Shell Dim f As Folder Private Sub Command1_Click() Set f = sh.BrowseForFolder(Me.hWnd, "SDFg", 0) MsgBox f.Title End Sub It works but it just gets the folder title not the path.. I wish to solve it using the Shell and Folder objects. ( I know the other solution using SHBrowseForFolder and SHGetPathFromIDList which you can find at : http://www.allapi.net/apilist/SHBrowseForFolder.shtml )

    R 1 Reply Last reply
    0
    • H Hesham Amin

      Hi.. I wish to share a small VB6 problem.. I want to display hte BrowseForFolder Dialog so the user can select a folder.. so I did this : add a reference to shell32.dll (or Microsoft Shell controls and Automation) the code : Option Explicit Dim sh As New Shell Dim f As Folder Private Sub Command1_Click() Set f = sh.BrowseForFolder(Me.hWnd, "SDFg", 0) MsgBox f.Title End Sub It works but it just gets the folder title not the path.. I wish to solve it using the Shell and Folder objects. ( I know the other solution using SHBrowseForFolder and SHGetPathFromIDList which you can find at : http://www.allapi.net/apilist/SHBrowseForFolder.shtml )

      R Offline
      R Offline
      Roger Stewart
      wrote on last edited by
      #2

      After you get the Folder object, use the FolderItems collection, like: Dim fiPath As String Set f = sh.BrowseForFolder(Me.hWnd, "SDFg", 0) Set fi = f.Items.Item filePath = fi.Path MsgBox filePath This will give you the full path of the item that was selected. You may need to add some checking against the FolderItem object because is maybe a 'special' folder and not have a Path associated with it (i.e MYCOMPUTER). Roger Stewart "I Owe, I Owe, it's off to work I go..."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups