Results 1 to 3 of 3

Thread: dialog box

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617
    Am using a dialog box to select a few files
    after-clicking on a command button

    So, say, I puck a file from U:
    then click again...

    How do I make it default to the last drive I selected from
    because it keeps going back to C:

    Thanks in advance

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    quebec
    Posts
    81

    Arrow

    Get the full path of the file selected then use the InitDir property of the dialog to set the new dir.

    Make a reference to the Scripting runtime in your project

    Code:
    Dim fs As FileSystemObject
    
    Private Sub Form_Load()
        Set fs = New FileSystemObject 'CreateObject("Scripting.FileSystemObject")
    End Sub
    
    Private Sub c2_Click()
        Dim s As String
            
        commonDialog1.ShowOpen 
        commonDialog1.InitDir = fs.GetAbsolutePathName(commonDialog.FileName)
    
    End Sub




    [Edited by hitcgar on 10-03-2000 at 12:31 PM]
    C/C++,Delphi,VB6,Java,PB (blech!),ASP,JSP,SQL...bla bla bla and bla
    I love deadlines. I like the whooshing sound they make as they fly by.
    —Douglas Adams

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ok

    Thanks..

    Will try it right now

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