Se puede utilizar el control OpenFileDialog para seleccionar carpetas?. Si alguien tiene un link, info... que pueda compartir, quizá algun control personalizado.
Lo último que se me ocurre es usar el SaveFileDialog.
Saludos.
buscando en ingles, encontré lo que buscaba.
link: http://www.codeproject.com/Articles/44914/Select-file-or-folder-from-the-same-dialog
comparto el code, quizá a alguien le interese.
Código
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.IO; using System.Windows.Forms; public class FileFolderDialog : CommonDialog { private OpenFileDialog dialog = new OpenFileDialog(); public OpenFileDialog Dialog { get { return dialog; } set { dialog = value; } } public new DialogResult ShowDialog() { return this.ShowDialog(null); } public new DialogResult ShowDialog(IWin32Window owner) { // Set validate names to false otherwise windows will not let you select "Folder Selection." dialog.ValidateNames = false; dialog.CheckFileExists = false; dialog.CheckPathExists = true; try { // Set initial directory (used when dialog.FileName is set from outside) if (dialog.FileName != null && dialog.FileName != "") { if (Directory.Exists(dialog.FileName)) dialog.InitialDirectory = dialog.FileName; else dialog.InitialDirectory = Path.GetDirectoryName(dialog.FileName); } } catch (Exception ex) { // Do nothing } dialog.FileName = "Folder Selection."; if (owner == null) return dialog.ShowDialog(); else return dialog.ShowDialog(owner); } /// <summary> // or returns file path /// </summary> public string SelectedPath { get { try { if (dialog.FileName != null && !Directory.Exists(dialog.FileName)) { return Path.GetDirectoryName(dialog.FileName); } else { return dialog.FileName; } } catch (Exception ex) { return dialog.FileName; } } set { if (value != null && value != "") { dialog.FileName = value; } } } /// <summary> /// </summary> public string SelectedPaths { get { if (dialog.FileNames != null && dialog.FileNames.Length > 1) { StringBuilder sb = new StringBuilder(); foreach (string fileName in dialog.FileNames) { try { sb.Append(fileName + ";"); } catch (Exception ex) { // Go to next } } return sb.ToString(); } else { return null; } } } public override void Reset() { dialog.Reset(); } protected override bool RunDialog(IntPtr hwndOwner) { return true; } }
uso:
Código
FileFolderDialog ffD = new FileFolderDialog(); ffD.ShowDialog(this);
Saludos.