Windows Forms: How to Create an Explorer-Style Application
This "How To" contains two sample applications that are both Explorer-like:
DirectoryScanner and ExplorerStyleViewer. The former is a simpler example of an
Explorer-style application, while the latter seeks to mimic some of the core
features of Windows Explorer.
Featured Highlights
-
DirectoryScanner is a fairly simple application that scans all
directories and sub-directories in either all logical drives or a user-selected
starting directory. A TreeView control displays the directory structure
reflecting the latest scan. Directories are colored green, yellow, or red based
on their total size inclusive of all sub-directories and files.
-
ExplorerStyleViewer is, as the name implies, a simpler version
of the Windows Explorer application. ExplorerStyleViewer makes known more file
information than DirectoryScanner, demonstrates how to associate icons with
file types, and allows the user to run an application associated with the file
type (if an association exists) by double-clicking the file (just like in
Windows Explorer).
Requirements
Microsoft Visual Studio.NET Professional or greater.
Windows 2000 or Windows XP.
Running the Sample
Simply press F5.
1. The Nodes.Count property does not appear in IntelliSense in
Visual Basic. (A similar problem occurs with PictureBox.AllowDrop). You can
still set this property programmatically, but you will get a precompile error
as you type until statement completion.
See Also
ListView TreeView