InitialDirectory: does it work for Pocket PC?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code that runs on a Pocket PC to set the init dir on a savefiledialog
to a my document sub directory. Even after the initdirectory method below is
run, the folder combo is still set to "None".

SaveFileDialog1.InitialDirectory = "\My Documents\Dude"

Is there any fix for this?
 
Thanks for your input. I already have a value for filename, see the VB.Net
code segment below (the folder does exist). Is this method not available in
CompactFramework, or is there a solution I have missed?
--------------------------------------------------------------
Dim SaveFileDialog1 As New SaveFileDialog
Dim Result As DialogResult
Dim sDudeDefault As String = "\My Documents\Dude"
If Not (Directory.Exists(sDudeDefault)) Then
Directory.CreateDirectory(sDudeDefault)
Directory.SetCurrentDirectory(sDudeDefault)

SaveFileDialog1.InitialDirectory = sDudeDefault 'This
InitialDirectory method does not work!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SaveFileDialog1.FileName = "Dude.sdf"
SaveFileDialog1.Filter = "Dude Data Files|*.sdf"
Result = SaveFileDialog1.ShowDialog()
----------------------------------------
 
On Pocket PC the Open and Save FileDialogs default to the My Documents
folder - the InitialDirectory property has no effect. It is supported on
other CE.NET platforms.

Peter
 
InitialDirectory works correctly when you change it within My Documents
directory. I mean "\My Documents\Dude" will work fine but only if you
set FileName to something that has not "Dude" value (e.g. "file.dat").
Otherwise folder combobox will have value "None" as Joe stated.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
Back
Top