(BUG?) Folder Dialog "NewFolder" button persists ...

Webtest

New member
Joined
Jun 11, 2004
Messages
2
Programming Experience
Beginner
(VB BUG?) Testing Folder & File Browser ...
NEWBIE ALERT!!!

Esteemed Forum Participants and Lurkers:

I an making my first attempt at using Folder and File selection Dialog Boxes. I know that I do not have to use BOTH, but I'm just playing with this primitive test just want to see how they both work.

I have one panel with one text box for the File Spec. Just to get started, double clicking on the text box is the event to open the path selection dialog.

It all seems to work EXCEPT ... the Folder Dialog box SHOWS the "New Folder" button, but the code sets
ShowNewFolderButton = False.
I can NOT get the dialog to pop up without the New Folder button.

Here is the code:


--------------------------------------------------------------------------------
' Text Box Component for File Name Selection
Private Sub q_SourcePath_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles q_SourcePath.DoubleClick

' Create an instance of the Folder Browser Popup Modal Dialog Box
Dim FolderBrowserDialog1 As New FolderBrowserDialog

' SETUP THE FOLDER BROWSER
' This is the descriptive text in the Folder Select Dialog Box
FolderBrowserDialog1.Description = "Select the Folder where the files are located"
' This is the default path for the Folder Browser
FolderBrowserDialog1.SelectedPath = "C:\Test\MyFiles\"
' Do NOT allow a new folder to be created in this dialog
FolderBrowserDialog1.ShowNewFolderButton = False

' Execute the Folder Browser
If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
' Put the selected Folder path in the Source Path Text Box
q_SourcePath.Text = FolderBrowserDialog1.SelectedPath
End If

' To do or not to do ... that is the question.
' These lines are probably totatlly superfluous since the instances
' of the Dialog boxes are local to this subroutine.
FolderBrowserDialog1.Dispose()
OpenFileDialog1.Dispose()
End Sub
--------------------------------------------------------------------------

I would appreciate any and all comments regarding this snippet, ESPECIALLY why the "NewFolderButton" persists when it is supposed to be "OFF".

Here is what I am running ...

Microsoft Development Environment 2003 v7.1.3088
Microsoft .NET Framework 1.1 v1.1.4322

Any ideas as to where to go from here?
 
Your code works fine for me including the ShowNewFolderButton bit... Don't know why it won't work in your case...

I'm running VS 2003 ver 7.1.3088, .NET Framework 1.1 ver 1.1.4322 SP1
 
Back
Top