Results 1 to 6 of 6

Thread: (VB BUG?) Testing Folder & File Browser ...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    (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

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I copied and pasted your code and the New Folder button did not show up on my BrowseFolder dialog.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045
    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

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    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!!

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    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

  6. #6
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310
    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

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width