|
-
Jun 9th, 2004, 03:49 PM
#1
Thread Starter
Frenzied Member
(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 and then the file selection dialogs.
It all seems to work EXCEPT ... the Folder Dialog box SHOWS the "New Folder" button, and the code sets
ShowNewFolderButton = False.
I can NOT get the dialog to pop up without the New Folder button.
Here is the code:
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
' Create an instance of the File Browser Popup Modal Dialog Box
Dim OpenFileDialog1 As New OpenFileDialog
' 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
' SETUP THE FILE BROWSER
' OpenFileDialog1.ShowHelp = False (False is the default)
' OpenFileDialog1.DefaultExt = "pdf" (Do this with the filter)
' Select only PDF files
OpenFileDialog1.Filter = "Select ONE prototype file|*.pdf"
' Do NOT allow selection of multiple files
OpenFileDialog1.Multiselect = 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
' Pass the Folder path to be the default path for the File Browser
OpenFileDialog1.InitialDirectory = q_SourcePath.Text
' Execute the File Browser
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
' Put the selected File Spec in the Source Path Text Box
q_SourcePath.Text = OpenFileDialog1.FileName
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".
Last edited by Webtest; Jun 11th, 2004 at 07:15 AM.
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Jun 9th, 2004, 04:08 PM
#2
I copied and pasted your code and the New Folder button did not show up on my BrowseFolder dialog.
-
Jun 9th, 2004, 04:24 PM
#3
Thread Starter
Frenzied Member
Negative0 ...
Boy, is this strange??? I just tried it again, and sure enough, it just created "New Folder (2)". I know it is the correct popup because I changed the Description text the update shows correctly!
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?
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Jun 9th, 2004, 04:42 PM
#4
hmm so you're saying that using the code above, a Make New Folder button DOES appear in your first dialog? because it does not appear for me either when I run that code
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jun 10th, 2004, 07:19 AM
#5
Thread Starter
Frenzied Member
Testing Folder & File Browser Popups ... Version Bug?
MrPolite ...
You wrote:
>> hmm so you're saying that using the code above, a Make New Folder button DOES appear in your first dialog? because it does not appear for me either when I run that code <<
Hmm ... not only am I saying that, but I even created a brand new project ... 1 form ... 1 text box ... double clicked on the development text box to get into the code editor, selected the double click event and generated the double click handler code, and cut and pasted the code right out of my post into the handler. I changed 3 instances of the component.text property to "TextBox1.text" because I left the name of the textbox as the default "TextBox1".
Guess what ... I hit F5 and double click the text box, and I STILL get the "New Folder" button on the folder dialog popup, and clicking it created the next sequential "New Folder (4)"!!!
I just tried it again this morning, and here is what I cut and pasted out of TextBox1 after going through both dialogs ...
C:\Test\MyFiles\New Folder (5)
How's that for weird?
Microsoft Development Environment 2003 v7.1.3088
Microsoft .NET Framework 1.1 v1.1.4322
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Aug 9th, 2004, 03:09 PM
#6
ok so is this broke, because i have it set to false too and it still shows and creates a new folder....i even set the **** thing to false 3 times....but hey it still shows
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
|