The FolderBrowser control can only be started in one of the predefined "special" folders. I wanted it to start in the current folder. Here is an example of how to do that:
First, add a FolderBrowserCallback event handler to the FolderBrowser object. Then add the following code specifying the directory you want the folder to open:
public static extern UInt32 SendMessage( IntPtr hWnd, UInt32 Msg, UInt32 wParam, IntPtr lParam);
private void folderBrowser1_FolderBrowserCallback(object sender, Syncfusion.Windows.Forms.FolderBrowserCallbackEventArgs e)
const int BFFM_SETSELECTIONW=1127;
Actually, that leaks, doesn't it. Instead of this:
RPRamesh Praveen Syncfusion Team August 11, 2003 07:21 AM
Thanks for the info! That's a big help, it's been a frequent feature request. We will log this in our KB.
MEMark EmersonAugust 26, 2003 04:43 PM
Thank you! I've been wanting the ability to set a start location in the .NET world for sometime and hated using the old VB6 controls within wrappers. Excellent!
MSMartin SchacherOctober 11, 2005 10:52 AM
Is there a workaround for vb to set the initial-directory?
>Thank you! I''ve been wanting the ability to set a start location in the .NET world for sometime and hated using the old VB6 controls within wrappers. Excellent!
ARAnupama Roy Syncfusion Team October 13, 2005 03:57 AM
The following features for FolderBrowser have been added to our build internally.
1) Enumeration value
FolderBrowserFolder.CustomStartLocation for Folder.StartLocation property.
2) FolderBrowserFolder.CustomStartLocation property for dialog root path.
3) FolderBrowserFolder.SelectLocation property for automatic scroll and highlight of desired path.
Which version of Syncfusion are you using now?