Question clear history in open file dialog

Bv_

New member
Joined
Jul 18, 2011
Messages
2
Programming Experience
Beginner
Hi,

I' m still learning vb.net, sorry if I'm asking a styupid question ...

I want to clear the history in an open file dialog, so that previous opened files won't be shown if a user clicks on the
drop down arrow behind "File name".
I have created an open file dialog and named it "ofd_openen".
Then I 've tried:

ofd_Openen.SafeFileNames = False
and also
ofd_Openen.FileNames.Clear()

but that doesn't work.
Any suggestions will be appreciated!
 
I am confused as to exactly what you are asking, do you wish to simply control the folder that comes up when opening the dialog?

VB.NET:
OpenFileDialog.InitialDirectory = "C:\"

This will always make your dialog open to the C drive.
 
No, what I want to do is this:

1) I open a file with the OpenFileDialog (for instance C:\Example.doc)
2) I want to open a second file with the OpenFileDialog (for instance C:\Test.doc) . At this time , I don't want to be able te see that C:\Example.doc has previously been opend.
In the OpenFileDialog, you have at the bottom "Filename: " and on the right-hand side of this a drop down box where the filename is shown which you have selected. But
if you click on the drop down arrow you can see the files you 've opened before the current file. It is this list I want to clear each time the OpenFileDialog is used.
 
The filenames property refers to the files that were selected by the dialog. I am not sure where this history comes from but I do know to what you are referring. I do not think there is a way to do this through code but there may be some way to do this through the OS or some other way.
 

Latest posts

Back
Top