|
-
May 8th, 2002, 08:51 PM
#1
Thread Starter
Junior Member
Can I get DirListBox to remember?
I'm trying to get the DirListBox to remember the last folder I openned? Can I do that?
-
May 8th, 2002, 08:54 PM
#2
Re: Can I get DirListBox to remember?
Originally posted by DavidH0011
I'm trying to get the DirListBox to remember the last folder I openned? Can I do that?
-
May 8th, 2002, 08:57 PM
#3
Thread Starter
Junior Member
No what I mean is - the next time I open the form with my directory list box I want it already be openned to the last folder I openned.
-
May 8th, 2002, 09:07 PM
#4
You can save the last open dir's path to a text file and then open it and retrive the path from the file, then set the DirListBox to that path
-
May 8th, 2002, 09:33 PM
#5
PowerPoster
Better yet use SaveSetting and Getsetting to save it in the registry.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
May 8th, 2002, 09:48 PM
#6
Frenzied Member
ya what he said 
VB Code:
Option Explicit
Private Sub Form_Load()
GetSetting(App.EXEName, "Options", "Last Dir") = Dir1.Dir
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Options", "Last Dir", Dir1.Dir
End Sub
-
May 8th, 2002, 10:00 PM
#7
Thread Starter
Junior Member
Moto I do that and I get
Method or data member not found.
Thoughts on how I could trouble shoot it?
GetSetting(App.ImageConverter, "Options", "Last Dir") = Dir1.Dir
-
May 8th, 2002, 10:08 PM
#8
Hyperactive Member
Try it the other way around. eg
Code:
Dir1.Dir = GetSetting(App.ImageConverter, "Options", "Last Dir", Default_Setting)
Where Default_Setting is a string containing a default path in case they haven't saved a setting yet.
-
May 8th, 2002, 10:10 PM
#9
Thread Starter
Junior Member
Getting close - same error but it is on a different part...
App.ImageConverter
-
May 8th, 2002, 10:13 PM
#10
The picture isn't missing
hey you were the one who added App.ImageConverter in Motoxpro code..... jeez......
VB Code:
Option Explicit
Private Sub Form_Load()
Dir1.Dir = GetSetting(App.EXEName, "Options", "Last Dir")
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Options", "Last Dir", Dir1.Dir
End Sub
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:14 PM
#11
The picture isn't missing
oops its not Dir1.Dir its Dir1.Path
VB Code:
Option Explicit
Private Sub Form_Load()
Dir1.Path= GetSetting(App.EXEName, "Options", "Last Dir")
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Options", "Last Dir", Dir1.Path
End Sub
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:15 PM
#12
Thread Starter
Junior Member
I dont remember adding my code to anything called Motoprox? I have not touched VB for over a year. Like anything in life you tend to forget things if you do not stay current and practice.
-
May 8th, 2002, 10:16 PM
#13
Thread Starter
Junior Member
Yea Buggy I figured that one out. I'm not a totall basket case. 
I just still cant get it to work
-
May 8th, 2002, 10:17 PM
#14
The picture isn't missing
oops it wasnt you it was the 'But_Why' guy...... and i have no idea why he added that part.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:20 PM
#15
The picture isn't missing
Originally posted by DavidH0011
Yea Buggy I figured that one out. I'm not a totall basket case. 
I just still cant get it to work
do you have a DirListBox called Dir1?
and maybe try putting
On error resume next
before the GetSetting part.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:22 PM
#16
Thread Starter
Junior Member
Yup
and as far as I can see my EXE is called ImageConverter
Hell I wrote the program it has just been soooo long
-
May 8th, 2002, 10:23 PM
#17
Thread Starter
Junior Member
This is exactly what it looks like
Private Sub Form_Load()
Dir1.Path = "c:\"
Dir1.Path = GetSetting(App.ImageConverter, "Options", "Last Dir")
End Sub
-
May 8th, 2002, 10:26 PM
#18
The picture isn't missing
try putting
On error resume next
because if there is not an entry there it will error i think.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:34 PM
#19
Thread Starter
Junior Member
Nah same result, the problem continues to be on the ".ImageConverter" in the App.ImageConverter
How can I confirm what my EXE is called?
-
May 8th, 2002, 10:36 PM
#20
The picture isn't missing
o my god...........
it doesnt mean replace it with it.
ACTUALLY USE .EXEName
MANANANAMNFMANVGMANDBMNASDBHNBHBKL
not .ImageConverter
GODOGODOGODGODOGODGODOG
sorry.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:37 PM
#21
The picture isn't missing
use my EXACT EXACT EXACT code. DONT CHANGE THE APP.EXENAME
VB Code:
Option Explicit
Private Sub Form_Load()
Dir1.Path= GetSetting(App.EXEName, "Options", "Last Dir")
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Options", "Last Dir", Dir1.Path
End Sub
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
May 8th, 2002, 10:38 PM
#22
Thread Starter
Junior Member
LMAO jee imagine that it works now.
-
May 8th, 2002, 10:48 PM
#23
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
|