Click here to Skip to main content
       

Visual Basic

 
GeneralRe: SaveFileDialog.ShowDialog() return value Pinmemberecony9-Apr-13 9:39 
GeneralRe: SaveFileDialog.ShowDialog() return value PinmvpEddy Vluggen9-Apr-13 9:59 
GeneralRe: SaveFileDialog.ShowDialog() return value PinmemberJohnny J.17-Apr-13 1:40 
GeneralRe: SaveFileDialog.ShowDialog() return value PinmvpEddy Vluggen17-Apr-13 1:53 
GeneralRe: SaveFileDialog.ShowDialog() return value PinmemberJohnny J.17-Apr-13 1:54 
AnswerRe: SaveFileDialog.ShowDialog() return value PinmvpRichard MacCutchan9-Apr-13 9:46 
GeneralRe: SaveFileDialog.ShowDialog() return value Pinmemberecony9-Apr-13 15:22 
QuestionWhat is the function of Filedialog.RestoreDirectory Pinmemberecony9-Apr-13 6:46 
In MSDN forum, it explains that:
the RestoreDirectory property to ensure that the current directory is restored when the dialog box is closed.
 
But I tried the example code, I can't find the difference between
RestoreDirectory = true or RestoreDirectory = false.
  
 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
 
        Dim myStream As Stream = Nothing
        Dim openFileDialog1 As New OpenFileDialog()
 
        openFileDialog1.InitialDirectory = "c:\"
        openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
        openFileDialog1.FilterIndex = 2
        openFileDialog1.RestoreDirectory = False
 
        If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            Try
                myStream = openFileDialog1.OpenFile()
                If (myStream IsNot Nothing) Then
                    ' Insert code to read the stream here. 
                End If
            Catch Ex As Exception
                MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
            Finally
                ' Check this again, since we need to make sure we didn't throw an exception on open. 
                If (myStream IsNot Nothing) Then
                    myStream.Close()
                End If
            End Try
        End If
    End Sub
 

AnswerRe: What is the function of Filedialog.RestoreDirectory PinmvpRichard MacCutchan9-Apr-13 6:59 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pinmemberecony9-Apr-13 7:05 
GeneralRe: What is the function of Filedialog.RestoreDirectory PinmvpRichard MacCutchan9-Apr-13 7:23 
GeneralRe: What is the function of Filedialog.RestoreDirectory PinprofessionalKenneth Haugland9-Apr-13 8:18 
GeneralRe: What is the function of Filedialog.RestoreDirectory PinmvpDave Kreskowiak9-Apr-13 11:36 
GeneralRe: What is the function of Filedialog.RestoreDirectory PinmvpRichard MacCutchan9-Apr-13 11:47 
AnswerRe: What is the function of Filedialog.RestoreDirectory PinmemberAlan N9-Apr-13 9:43 
AnswerRe: What is the function of Filedialog.RestoreDirectory PinmvpRichard MacCutchan9-Apr-13 22:32 
QuestionHow to check if one button is active [ solved ] [modified] Pinmemberecony9-Apr-13 5:30 
AnswerRe: How to check if one button is active PinmvpDave Kreskowiak9-Apr-13 11:39 
GeneralRe: How to check if one button is active Pinmemberecony9-Apr-13 15:24 
QuestionButton text related to click event [solved] [modified] Pinmemberecony9-Apr-13 3:59 
AnswerRe: Button text related to click event PinprofessionalKenneth Haugland9-Apr-13 4:26 
GeneralRe: Button text related to click event Pinmemberecony9-Apr-13 5:06 
AnswerRe: Button text related to click event PinmemberDavid Mujica9-Apr-13 4:26 
QuestionTime in and time out windows form in vb.net PinmemberNOORULLA KHAN8-Apr-13 23:16 
Question[SOLVED] Word 2010 VBA - Change font color by RGB by find and replace [modified] PinmemberBart Van Eyndhoven8-Apr-13 22:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 1 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid