我如何在 FolderBrowserDialog 中显示文本框,如下图所示,
最佳答案
这不是直接可能的,您必须回退到使用 shell 函数。项目 + 添加引用,浏览选项卡,选择 c:\windows\system32\shell32.dll。如何在 Winforms 应用程序中使用它的示例:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim options As Integer = &H40 + &H200 + &H20
options += &H10 '' Adds edit box
Dim shell = New Shell32.ShellClass
Dim root = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim folder = CType(shell.BrowseForFolder(CInt(Me.Handle), _
"Select folder", options, root), Shell32.Folder2)
If folder IsNot Nothing Then
MsgBox("You selected " + folder.Self.Path)
End If
End Sub
关于vb.net - 在 FolderBrowserDialog 中显示文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14927766/