Standard drive/network tree view in c# - c#

Is there a control that I can use that operates like windows explorer for selecting drives and network resources or does this functionality have to be built from scratch? Specifically I am talking about the left panel of explorer where you can select the different drives on the PC or the network.
I went through the list of the default controls and I don't see one offhand.
Thanks!

Related

How do I use .NET or the Windows API to change the View columns in a particular folder in Windows Explorer? (Windows 7 and Up)

When browsing a folder in Windows Explorer, I can use the user interface to add additional columns to my view that are typically not there when browsing the folder, such as "File extension" or "Language." In Windows 10, you perform this action by clicking the "View" tab, clicking "Add Columns," clicking "Choose columns...," then selecting the desired columns and clicking "OK."
What I would like to do is perform this action programmatically, ideally adding any column from that list to a chosen directory with hopes of populating that column with metadata. I was looking extensively into methods that could accomplish this, such as the Column Handler shell extension, but support for IColumnHandler was dropped after XP and simply won't work.
From there, the only possible option is to use the Property Handler in the Windows API and read the values directly from the registry. However, I am not sure how to go about doing that. I have tried finding some samples online of how to perform this, and it's led me to a bunch of dead ends all around. I understand it must be difficult, but I am sure someone has managed to make it work.
Does anyone has any examples or guidance on how to use the Property Handler in the Windows API to add columns to a View in a Windows Explorer folder? Do I have any other options? Any feedback is appreciated.
in a shell view, you choose columns by calling IColumnManager::SetColumns with an array of PROPERTYKEY structures.
Assuming you have a Windows Explorer window's IShellBrowser interface, call GetActiveShellView to get the shell view, then query the view object for IColumnManager (a cast in C#).

Does WPF have a control for browsing the local file system?

I would like to add a control to my app where the user can browse his local file system and select a directory. I would prefer to host this control on my main app window, and not do this via a pop-up dialog.
There isn't one built in.
You can either use the WinForms file/folder browser, search Code Project or similar site for someone else's implementation or write your own.
I've found one on Ookii Dialogs that includes some other standard dialogs.
If you want to host the controls on your own form, use controls from Shell MegaPack.WPF

How to create an Explorer-like folder browser control?

Using C# and WinForms in VS2008, I want to create a file browser control that looks and acts like the left pane in Windows Explorer. To my astonishment, such a control does not ship with .NET by default.
Ideally, I would like its contents to be exactly the same as in Explorer. For example, on Windows 7, it should show the Favorites and Libraries pseudo-folders. Of course, I do not want to code specifically for each version of Windows if I can help it.
I have browsed around, and there are some examples of such controls, but they are all hand-rolled and therefore won't work 100% the same as the one in Explorer.
Is there any way I can simply reuse the Explorer control instead? Or, if not, to get access to a tree of the items that it would show?
Microsoft provides a walkthrough for creating a Windows Explorer style interface in C#.
There are also several examples on Code Project and other sites. Immediate examples are Explorer Tree, My Explorer, File Browser and Advanced File Explorer but there are others. Explorer Tree seems to look the best from the brief glance I took.
I used the search term windows explorer tree view C# in Google to find these links.
It's not as easy as it seems to implement a control like that. Explorer works with shell items, not filesystem items (ex: the control panel, the printers folder, and so on). If you need to implement it i suggest to have a look at the Windows shell functions at http://msdn.microsoft.com/en-us/library/bb776426(VS.85).aspx.
Take a look at Shell MegaPack control set. It provides Windows Explorer like folder/file browsing with most of the features and functionality like context menus, renaming, drag-drop, icons, overlay icons, thumbnails, etc

What C# / Win32 Control Is the Wireless Network Dialog Using?

I'm working on an application, and I have a screen that in my mind, looks a lot like the Wireless Network List in Windows Vista. For those who are unaware, its basically a listview, but in each row, instead of a line of text, there's a large 'panel' that contains all sorts of useful information. Does anyone know if that's an actual UI control available on windows, or should I roll my own with some sort of autosizing table layout panel hosting a collection of custom controls?
I know this is pretty easy to make using WPF using the stackpanel layout along with a series of user controls containing grid controls for internal layout. Or are you using windows forms?
The wireless network dialog isn't using a standard Win32 control, it's using a custom control (effectively).
If you want to emulate that behavior, you're going to have to use WPF or roll your own.
Not an exact answer but you may want to look at the various Vista TaskDialog libraries and dialogs that have been based on that. You may be able to borrow some of the code since they share some UI functionality. I need to do the something similar with WPF.

Displaying Flash content in a C# WinForms application

What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content.
It would be great to be able to load the flash content from a stream of sorts rather than a file on disk.
While I haven't used a flash object inside a windows form application myself, I do know that it's possible.
In Visual studio on your toolbox, choose to add a new component.
Then in the new window that appears choose the "COM Components" tab to get a list in which you can find the "Shockwave Flash Object"
Once added to the toolbox, simply use the control as you would use any other "standard" control from visual studio.
three simple commands are available to interact with the control:
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Movie = FilePath &
"\FileName.swf"
AxShockwaveFlash1.Play()
which, I think, are all self explanatory.
It would be great to be able to load
the flash content from a stream of
sorts rather than a file on disk.
I just saw you are also looking for a means to load the content from a stream,
and because I'm not really sure that is possible with the shockwave flash object I will give you another option (two actually).
the first is the one I would advise you to use only when necessary, as it uses the full blown "webbrowser component" (also available as an extra toolbox item), which is like trying to shoot a fly with a bazooka.
of course it will work, as the control will act as a real browser window (actually the internet explorer browser), but its not really meant to be used in the way you need it.
the second option is to use something I just discovered while looking for more information about playing flash content inside a windows form. F-IN-BOX is a commercial solution that will also play content from a given website URL. (The link provided will direct you to the .NET code you have to use).
Sven, you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The F-IN-BOX, although just a wrapper of the Shockwave Flash Object seems to provide much more functionality, which may just help me!
Shooting flys with bazookas may be fun, but an embeded web brower is not the path that I am looking for. :)
There was a link on Adobe's site that talked about "Embedding and Communicating with the Macromedia Flash Player in C# Windows Applications" but they seem to have removed it :(

Categories

Resources