Using Invoke Code to do a proper Select Folder dialog

This one is pretty simple.

image

Dim FBD As New System.Windows.Forms.FolderBrowserDialog
Dim FBDResult As New System.Windows.Forms.DialogResult
FBDResult = FBD.ShowDialog
If (FBDResult = DialogResult.OK And Not String.IsNullOrWhiteSpace(FBD.SelectedPath)) Then
		FBDPath = FBD.SelectedPath
	Else
		FBDPath = ""
End If

Arguments:

Simple as that, now FBDPath has the path selected in the dialog.

1 Like

FYI there are lots of options you can set before calling ShowDialog to customize it for your needs: