In vb 6.0, how do I get a directly list box to display the last opened/saved file path. Any help is appreciated.
Printable View
In vb 6.0, how do I get a directly list box to display the last opened/saved file path. Any help is appreciated.
You need to store the filename somewhere in a variable whenever you open/save a file.
VB Code:
Dim LastFileName As String Sub OpenFile(FileName As String) LastFileName = FileName ' code to open file End Sub Sub SaveFile(FileName As String) LastFileName = FileName ' code to save file End Sub
Thanks.. but I want it to remember after you close and reopen the program. I guess you would have to save it in an external file...
(oops i guess ur code does do that :P)
Or simply store it in the registry using the savesetting function
What kind of an alternative do you want?
What should it do that my example doesn't?
how would i save it in the registry?? (I donno how) :(
I don't have vb here.Heres how to do
Type savesetting then hit space and it will show you the arguments.Use getsetting to retrieve the values
Thanks guys. It worked :P
VB Code:
Call SaveSetting(App.EXEName, "SaveLastPath", "Open", dlstbox.path)
VB Code:
dlstbox.path = GetSetting(App.EXEName, "SaveLastPath", "Open", "")
Mark your thread as resolved then and rate the posts you found useful if any