打开文件夹对话框

时间:2019-11-25 01:55:49

标签: vb.net

我想知道是否可以创建一个显示类似于此弹出窗口的OpenfolderDialog :(我正在使用此代码浏览文件,但是我也想使用此代码浏览文件夹。< / p>

我想要什么:

What I want

这是代码:

' Initialize the OpenFileDialog to look for DWG files.
    openFile1.Title = "Open File Dialog"    'Title header for dialog box
    openFile1.InitialDirectory = "C:\" 'Inital directory for file dialog box
    openFile1.Filter = "All files (*.*)|" 'Filter all files
    openFile1.Multiselect = True 'Allows the user to select to select multiple files

    If openFile1.ShowDialog() = DialogResult.OK Then 'This gives the "ok" to actually open the pop-up window
        Header_Info_Sheet.Range("E11").Value = "File Path:"
        strFileName = openFile1.FileName  'Stores the Filename inside the variable
        Header_Info_Sheet.Range("F11").Value = strFileName 'Shows the variable FilePath
    End If

现在我有类似的东西:

What I have

这是它的代码:

    Dim folderBrowserDialog1 As New FolderBrowserDialog

    folderBrowserDialog1.ShowDialog()

0 个答案:

没有答案