Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created February 24, 2012 06:30
Show Gist options
  • Select an option

  • Save anaisbetts/1898398 to your computer and use it in GitHub Desktop.

Select an option

Save anaisbetts/1898398 to your computer and use it in GitHub Desktop.
/// <summary>
/// Launches a dialog to browse for a dialog
/// </summary>
/// <param name="selectedPath">The path that should be selected when the dialog is open.</param>
/// <returns>Returns the path if a folder is selected and user clicks OK. Otherwise returns null.</returns>
public static string BrowseForFolder(string selectedPath)
{
if (Environment.OSVersion.Version.Major < 6)
{
return BrowseForFolderIfOperatingSystemIsSad(selectedPath);
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment