var dialog = new FolderBrowserDialog(); dialog.ShowDialog(); folderpathTB.Text = dialog.SelectedPath;