OpenFileDialog and SaveFileDialog
what code do you use for the openfiledialog and savefiledialog, For a PocketPC app, I tryed what I know for vb.net but it dosent work, if you have already guess im a total noob in mobile Development.
Im using Visual Basic .net 2003, It has Mobile Development with it.
Re: OpenFileDialog and SaveFileDialog
There are openfiledialog and savefiledialog controls for mobile devices in the VB.Net toolbox.
What code did you try that didn't work?
Pete
Re: OpenFileDialog and SaveFileDialog
heres the savedialog i used.
VB Code:
SaveFileDialog1.Filter = "Text files (*.txt)|*.txt"
SaveFileDialog1.ShowDialog()
If SaveFileDialog1.FileName <> "" Then
FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
PrintLine(1, txtNote.Text) 'copy text to disk
FileClose(1)
End If
and heres the opendialog i used.
VB Code:
Dim AllText, LineOfText As String
ofd.Filter = "Text files (*.txt)|*.txt;"
ofd.ShowDialog() 'display Open dialog box
If ofd.FileName <> "" Then
Try 'open file and trap any errors using handler
FileOpen(1, ofd.FileName, OpenMode.Input)
Do Until EOF(1) 'read lines from file
LineOfText = LineInput(1)
'add each line to the AllText variable
AllText = AllText & LineOfText & vbCrLf
Loop
txtOutput.Text = AllText 'display file
txtOutput.Select(1, 0) 'remove text selection
txtOutput.Enabled = True 'allow text cursor
MenuItem3.Enabled = False
MenuItem4.Enabled = True
Catch
MsgBox("Error opening file.")
Finally
FileClose(1) 'close file
End Try
End If
Re: OpenFileDialog and SaveFileDialog
Hi,
where do you get the error, as the code below works fine
VB Code:
OpenFileDialog1.Filter = "Text files(*.txt)|*.txt"
OpenFileDialog1.ShowDialog()
MsgBox(OpenFileDialog1.FileName)
SaveFileDialog1.Filter = "Text files(*.txt)|*.txt"
SaveFileDialog1.ShowDialog()
MsgBox(SaveFileDialog1.FileName)
Pete