1

is it possible to open a directory on windows form? and show all its contents just like opening it actually like in windows explorer UI?

how, what is the code for this operation? C# code. i cant figure it out

jeo
  • 85
  • 2
  • 7
  • 1
    If I post "Yes, it's possible", do I get it right? This is not an answerable question. I'd suggest you look into the [Windows Shell](http://msdn.microsoft.com/en-us/library/windows/desktop/bb773177(v=vs.85).aspx) and it's available interfaces, which are all useable from C#, and come back with questions that are specific that you need help solving. :) – Ken White Nov 19 '11 at 05:12

3 Answers3

2

The ExplorerBrowser C# sample program shows how to host an Explorer window inside a Windows Forms form or a WPF window.

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
0

There are a number of articles on codeproject.com showing how to create a Windows Explorer like UI using standard Winform controls. These look promising:

Windows Explorer in C#
A Windows Explorer in a user control

There are others though.

I'd start with one of these and modify to suit your needs.

Jay Riggs
  • 53,046
  • 9
  • 139
  • 151
0

Yes - see the folder browser control http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx

You however have to include the shell events when someone double clicks on a file to launch it, such as calling process.start. There are tons of examples out there and many ways to accomplish this. For ex. a quick google search http://www.codeproject.com/KB/miscctrl/FileManager.aspx

Embedding a File Explorer instance in a Windows Forms application form

Community
  • 1
  • 1
Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71