Visual Basic Help (FolderBrowserDialog)

Associate
Joined
4 Mar 2007
Posts
315
Location
United Kingdom
Ok well i am in the process of learning Visual Basic but have bumped into a small hurdle, primarily around this folderbrowserdialog

I want to be able to open the folder which ive selected in the browser dialogue when the button OK is pressed. Here is my current code.

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles materials.Click
        Dim Folder_Browse_Materials As New FolderBrowserDialog

        With Folder_Browse_Materials
            .RootFolder = Environment.SpecialFolder.Desktop

            .SelectedPath = path_name

            .Description = "Select Source Dir"
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
' THIS IS WHERE THE OPEN THE FOLDER SCRIPT SHOULD GO RIGHT? '
            End If
        End With

    End Sub

I tried using Shell on the defined Dims and Consts As the general idea of the script was to just test around file navigation on my system for instance the path_name was a public const i had defined which had a route of "C:\Windows" now i know if i were to shell like shell("explorer C:\Windows") it would open that directory, but i want to do it with a public const that i had defined or even a dim value as string for instance.
So how would i go about the first step of opening the file that has been selected?
Thanks.
 
hrm seems like a better use, although how would i go about executing the selected directory using this method?
I understand the dialogresult is that of the selected folder in the browser but if i were to simply do something like msgbox(dialogresult) the result is 1 (guessing as its in an if) so how would i go about open up the dialogresult in a shell window?
 
Back
Top Bottom