Select a directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaiful
    New Member
    • Oct 2007
    • 89

    Select a directory

    Hi all, How can I select a directory from computer by browsing a button in VB. I mean my problem is I want to put a button on from can select a directory , thx for try advance, Shai
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #2
    Originally posted by shaiful
    Hi all, How can I select a directory from computer by browsing a button in VB. I mean my problem is I want to put a button on from can select a directory , thx for try advance, Shai
    Add Common Dialog Control.
    and add this code to a commandbutton
    Code:
    commondialog1.showopen
    or add a drive, file and Dir listbox to a form and add this code

    Code:
    Private Sub Drive1_Change()
    
    Dir1.Path = Drive1.Drive
    
    End Sub
    
    Private Sub Dir1_Change()
    
    File1.Path = Dir1.Path
    
    End Sub
    
    Private Sub File1_Click()
    
    Text1.Text = File1.FileName
    
    End Sub
    In text1 selected file name will appear.

    GOODLUCK
    ALI

    Comment

    Working...