Hi guys,
I thought you might find this interesting. After getting thoroughly frustrated with the complexity of making the SHBrowseForFolder API work, I did a search on GotDotNet and found the attached example.
It's really cool and complete. If you find this useful, cheers!
I'm giving acknowledgement to vrk75 whoever he may be. There's not much else for a reference.
or you could always my BrowseForFolder class with a lot less lines of code
Code:
using System.Windows.Forms;
using System.Windows.Forms.Design;
public class BrowseForFolder : FolderNameEditor
{
FolderNameEditor.FolderBrowser fBrowser = new System.Windows.Forms.Design.FolderNameEditor.FolderBrowser();
public BrowseForFolder()
{
}
public string ShowIt()
{
fBrowser.Description = "Choose A Directory...";
fBrowser.ShowDialog();
return fBrowser.DirectoryPath;
}
~BrowseForFolder()
{
fBrowser.Dispose();
}
}
usage
Code:
BrowseForFolder go = new BrowseForFolder();
MessageBox.Show(go.ShowIt());
Originally posted by Cander or you could always my BrowseForFolder class with a lot less lines of code
Code:
using System.Windows.Forms;
using System.Windows.Forms.Design;
public class BrowseForFolder : FolderNameEditor
{
FolderNameEditor.FolderBrowser fBrowser = new System.Windows.Forms.Design.FolderNameEditor.FolderBrowser();
public BrowseForFolder()
{
}
public string ShowIt()
{
fBrowser.Description = "Choose A Directory...";
fBrowser.ShowDialog();
return fBrowser.DirectoryPath;
}
~BrowseForFolder()
{
fBrowser.Dispose();
}
}
usage
Code:
BrowseForFolder go = new BrowseForFolder();
MessageBox.Show(go.ShowIt());
now tell me...who da man?
<starts flexing muscles and posing>
thank god once again for WinCV...LOL
you been hacking my computer
?
just you stole that from me
damn it
Cander,
I looked at it and it doesn't have what I'm looking for. You can set the startup dir to a special windows folder, but not to a user defined path (like "c:\MyFolder"). You can correct me if I'm wrong, but the StartLocation property is just an FolderBrowserFolder Enum.