|
-
Oct 3rd, 2000, 10:18 AM
#1
Thread Starter
Fanatic Member
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
-
Oct 3rd, 2000, 11:29 AM
#2
Lively Member
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
-
Oct 3rd, 2000, 02:57 PM
#3
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|