Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

Double-click a folder browser dialog?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Veeneman - 05 Oct 2007 16:21 GMT
I'm trying to implement some fairly standard behavior (or so I thought) on a
FolderBrowserDialog component. double-clicking a folder in the dialog should
have the same effect as selecting the folder and clicking the dialog's OK
button. But the FolderBrowserDialog component doesn't implement that
behavior, and it doesn't have a double-click event that would allow me to
implement it.

Is there a simple way to implement this behavior? Thanks.
Nicholas Paldino [.NET/C# MVP] - 05 Oct 2007 17:21 GMT
David,

   Unfortunately, this isn't made available to you.  It's not even
available through the API call SHBrowseForFolder (which is what the
FolderBrowserDialog calls, ultimately).  You could try and derive from
FolderBrowserDialog, and replace the hook procedure (HookProc) as well as
the RunDialog procedure and then get the window handle for the tree view,
but that's VERY implementation specific, and I wouldn't depend on it.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> I'm trying to implement some fairly standard behavior (or so I thought) on
> a FolderBrowserDialog component. double-clicking a folder in the dialog
[quoted text clipped - 4 lines]
>
> Is there a simple way to implement this behavior? Thanks.
Ignacio Machin ( .NET/ C# MVP ) - 05 Oct 2007 21:02 GMT
> David,
>
>    Unfortunately, this isn't made available to you.  It's not even
> available through the API call SHBrowseForFolder (which is what the
> FolderBrowserDialog calls, ultimately).  You could try and derive from
> FolderBrowserDialog,

IIRC FolderBrowserDialog  is a sealed class.

Yep, it says so in the MSDN:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialo
g.aspx

Nicholas Paldino [.NET/C# MVP] - 05 Oct 2007 21:11 GMT
That sucks.  In that case, the OP should extend CommonDialog and call
SHBrowseForFolder, and try to find the tree view window, or like you said,
get a third party implementation.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>> David,
>>
[quoted text clipped - 7 lines]
> Yep, it says so in the MSDN:
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialo
g.aspx
Ignacio Machin ( .NET/ C# MVP ) - 05 Oct 2007 21:01 GMT
Hi,

> I'm trying to implement some fairly standard behavior (or so I thought) on
> a FolderBrowserDialog component. double-clicking a folder in the dialog
> should have the same effect as selecting the folder and clicking the
> dialog's OK button. But the FolderBrowserDialog component doesn't
> implement that behavior, and it doesn't have a double-click event that
> would allow me to implement it.

Unfortunatelly that feature is not available, not only that but
FolderBrowserDialog is a sealed class, so you cannot inherit from it.

You either implement your own FolderBrowserDialog  from the scratch or look
around for a third party implementation
G Himangi - 06 Oct 2007 05:41 GMT
>>or look around for a third party implementation

Take a look at Shell MegaPack controls from http://www.ssware.com

G Himangi

> Hi,
>
[quoted text clipped - 10 lines]
> You either implement your own FolderBrowserDialog  from the scratch or
> look around for a third party implementation

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.