VBDOS Pro 1.0: Remembering last dir. in a File|Save dialog?
-
- Veteran
- Posts: 111
- Joined: Sat Feb 21, 2009 8:19 am
- Location: New York, U.S.
VBDOS Pro 1.0: Remembering last dir. in a File|Save dialog?
I have a Visual Basic program that uses the File|Open and File|SaveAs dialg boxes and want to peserve the last directoy usd by such dialog boxes--even if the use clicks Cancel. How do I do that? Or do I need to create my own?
Joseph Rose, a.k.a. Harry Potter
Creating magic in the computer community...or at least striving to!![Sad :(](./images/smilies/icon_sad.gif)
Creating magic in the computer community...or at least striving to!
![Sad :(](./images/smilies/icon_sad.gif)
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
In QB64 we use a TYPE to set the dialog box settings.
http://qb64.net/wiki/index.php?title=Wi ... alog_Boxes
In VB you would look in the Dialog Box properties list and set InitDir. ".\" sets it to always be the current directory.
Cancel doesn't change anything, but it will stay in the last folder when you select a file with nothing in the setting box.
You can set the value in the program like this:
Cdlname.InitDir = "C:\"
Where Cdlname is the name you give the CDL object. That only works the first time it is used however.
http://qb64.net/wiki/index.php?title=Wi ... alog_Boxes
In VB you would look in the Dialog Box properties list and set InitDir. ".\" sets it to always be the current directory.
Cancel doesn't change anything, but it will stay in the last folder when you select a file with nothing in the setting box.
You can set the value in the program like this:
Cdlname.InitDir = "C:\"
Where Cdlname is the name you give the CDL object. That only works the first time it is used however.
Last edited by burger2227 on Mon Mar 05, 2012 12:12 pm, edited 1 time in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
-
- Veteran
- Posts: 111
- Joined: Sat Feb 21, 2009 8:19 am
- Location: New York, U.S.
Okay, now how do I do that? I want to preserve the directory without changing the current system directory if possible even when the user hits Cancel.In VB you would look in the Dialog Box properties list and set InitDir. ".\" sets it to always be the current directory.
Joseph Rose, a.k.a. Harry Potter
Creating magic in the computer community...or at least striving to!![Sad :(](./images/smilies/icon_sad.gif)
Creating magic in the computer community...or at least striving to!
![Sad :(](./images/smilies/icon_sad.gif)
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Add 8 to the Cdlname.flag value or use cdlOFNNoChangeDir to stay in the current dir.
However it doesn't seem to stay there after a file is selected on my machine.
It always starts at the last folder you selected a file from.
http://msdn.microsoft.com/en-us/library/aa259317
However it doesn't seem to stay there after a file is selected on my machine.
It always starts at the last folder you selected a file from.
http://msdn.microsoft.com/en-us/library/aa259317
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
-
- Veteran
- Posts: 111
- Joined: Sat Feb 21, 2009 8:19 am
- Location: New York, U.S.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
NO YOU DIDN'T!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0