|
-
May 21st, 2006, 07:59 PM
#1
Thread Starter
Hyperactive Member
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.
-
May 22nd, 2006, 01:33 AM
#2
Frenzied Member
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
-
May 22nd, 2006, 02:17 AM
#3
Thread Starter
Hyperactive Member
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
-
May 22nd, 2006, 04:56 PM
#4
Frenzied Member
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
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
|