Click here to Skip to main content
13,796,047 members

Visual Basic

 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
econy9-Apr-13 10:39
memberecony9-Apr-13 10:39 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
Eddy Vluggen9-Apr-13 10:59
professionalEddy Vluggen9-Apr-13 10:59 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
Johnny J.17-Apr-13 2:40
professionalJohnny J.17-Apr-13 2:40 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
Eddy Vluggen17-Apr-13 2:53
professionalEddy Vluggen17-Apr-13 2:53 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
Johnny J.17-Apr-13 2:54
professionalJohnny J.17-Apr-13 2:54 
AnswerRe: SaveFileDialog.ShowDialog() return value Pin
Richard MacCutchan9-Apr-13 10:46
protectorRichard MacCutchan9-Apr-13 10:46 
GeneralRe: SaveFileDialog.ShowDialog() return value Pin
econy9-Apr-13 16:22
memberecony9-Apr-13 16:22 
QuestionWhat is the function of Filedialog.RestoreDirectory Pin
econy9-Apr-13 7:46
memberecony9-Apr-13 7: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 Pin
Richard MacCutchan9-Apr-13 7:59
protectorRichard MacCutchan9-Apr-13 7:59 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pin
econy9-Apr-13 8:05
memberecony9-Apr-13 8:05 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pin
Richard MacCutchan9-Apr-13 8:23
protectorRichard MacCutchan9-Apr-13 8:23 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pin
Kenneth Haugland9-Apr-13 9:18
professionalKenneth Haugland9-Apr-13 9:18 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pin
Dave Kreskowiak9-Apr-13 12:36
mvpDave Kreskowiak9-Apr-13 12:36 
GeneralRe: What is the function of Filedialog.RestoreDirectory Pin
Richard MacCutchan9-Apr-13 12:47
protectorRichard MacCutchan9-Apr-13 12:47 
AnswerRe: What is the function of Filedialog.RestoreDirectory Pin
Alan N9-Apr-13 10:43
memberAlan N9-Apr-13 10:43 
AnswerRe: What is the function of Filedialog.RestoreDirectory Pin
Richard MacCutchan9-Apr-13 23:32
protectorRichard MacCutchan9-Apr-13 23:32 
QuestionHow to check if one button is active [ solved ] Pin
econy9-Apr-13 6:30
memberecony9-Apr-13 6:30 
AnswerRe: How to check if one button is active Pin
Dave Kreskowiak9-Apr-13 12:39
mvpDave Kreskowiak9-Apr-13 12:39 
GeneralRe: How to check if one button is active Pin
econy9-Apr-13 16:24
memberecony9-Apr-13 16:24 
QuestionButton text related to click event [solved] Pin
econy9-Apr-13 4:59
memberecony9-Apr-13 4:59 
AnswerRe: Button text related to click event Pin
Kenneth Haugland9-Apr-13 5:26
professionalKenneth Haugland9-Apr-13 5:26 
GeneralRe: Button text related to click event Pin
econy9-Apr-13 6:06
memberecony9-Apr-13 6:06 
AnswerRe: Button text related to click event Pin
David Mujica9-Apr-13 5:26
memberDavid Mujica9-Apr-13 5:26 
QuestionTime in and time out windows form in vb.net Pin
NOORULLA KHAN9-Apr-13 0:16
memberNOORULLA KHAN9-Apr-13 0:16 
Question[SOLVED] Word 2010 VBA - Change font color by RGB by find and replace Pin
Bart Van Eyndhoven8-Apr-13 23:31
memberBart Van Eyndhoven8-Apr-13 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Cookies | Terms of Service
Web05 | 2.8.181207.3 | Last Updated 11 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid