Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(Dir1...Drive1...File1)Just don't work as usually.

Status
Not open for further replies.

lulo

Programmer
Jan 24, 2001
51
0
0
US
Anybody..........

Everytime a insert a Drive1 control into my form from the toolbox, Drive1 is already at the r:(my network drive) drive when it should start a c: drive(at design time).
So this really pause my application for quiet a while. any ideas?
I recently install service pack 5.

Your commments are appreciated.

Thanks

Lulo

 
Yeah, it does that sometimes.
At runtime, when your form loads, you can reset the Drive control to point to the current directory with:

Drive1.ListIndex = 1
(which is usually the C: drive)

Be careful of this code on machines that do not have a floppy drive, as index 0 would then be C:

Chip H.
 
Thanks Chiph,
Your sugestion works fine.
But everytime a put a Drive1, Dir1, File1 control in my form it takes a few seconds before it shows, it is not as usually anymore.
And I think the time it takes to show, it is because is looking for r:\ Drive.
I need to be able to replace the settings for that control or replace the whole file instead.

Do you know what DLL or OCX I should take care of?


Thanks

Lulo
 
Why you don't use Commondialog box ? _____________________________
Hugues Gauthier P.A,DEC
Programmeur Analyste
Progitech GS Inc.
hugues.gauthier@progitech.com
hugues_gauthier@hotmail.com
Tel. : (418) 698-4383 #19
Fax.: (418) 698-8633
---------------------
ICQ: 2151800
 
You might also try setting the default drive prior to loading the form:[tt]

Sub Main()
ChDrive "C:"
Form1.Show
End Sub
[/tt]
Just set Sub Main as the startup object in Project Properties.
VCA.gif

Alt255@Vorpalcom.Intranets.com​
 
Thanks guys,
Now the file has been reset back to what it was and I didn't do anything. So probably this a glitch on vb.

I could had used a common dialog box but I'm looking for files in the file list that the user don't need to see.

Thanks a lot, I appreciate, nice help.


Lulo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top