Click here to Skip to main content
11,428,497 members (62,601 online)
Click here to Skip to main content

Implementing a common File system browser with a ListView

, 24 Sep 2003
Rate this:
Please Sign up or sign in to vote.
A ListView Control like the one used in Windows Explorer
<!-- Article image -->

Sample Image - FileSystemListView.jpg

<!-- Add the rest of your HTML here -->

Introduction

Very often, we need to have a control for browsing the user file-system in order to select files or folders in our applications. But Microsoft did not include a control like that with Visual Studio .NET, so I gave it a try and developed a ListView component very similar to the one used in Windows Explorer.

Exceptions

  • Please note that Shell operations are not implemented and are not planned.
  • The "My Documents" icon is not the good one.

Key Features

  • Use the System ImageList for retrieving the icons (pretty fast)
  • Allows to get back to the parent folder (..), so you don't need a companion control or other button for doing that. (AllowParentFolderSelection property)

Usage

Just drag the component onto your form and call the control's Initialize() method in the form Load event.

Conclusions

So this is it. Maybe it will give you a good start for a more complete version.

Credits

  • Thanks to Furty for his works with his TreeView control. It gave me ideas for mine and I used the Shell32 stuff he discovered in coding his control.
  • SystemListView code developed and borrowed from Steve McMahon. Click here for his article.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jonathan Gauthier
Architect CGI
Canada Canada
No Biography provided

Comments and Discussions

 
GeneralMy vote of 5 Pin
Cpei1-Mar-11 20:06
memberCpei1-Mar-11 20:06 
GeneralAdd-in Code to select a default custom Folder on opening Pin
kabamaru13-Dec-10 10:35
memberkabamaru13-Dec-10 10:35 
QuestionDoesn't seem to work on VS 2005, have any idea why? Pin
trogov11-Dec-07 21:46
membertrogov11-Dec-07 21:46 
AnswerRe: Doesn't seem to work on VS 2005, have any idea why? Pin
trogov17-Dec-07 6:30
membertrogov17-Dec-07 6:30 
QuestionUpgrading To .Net 2.0 Pin
AndreGr13-Nov-06 0:45
memberAndreGr13-Nov-06 0:45 
AnswerRe: Upgrading To .Net 2.0 Pin
AndreGr14-Nov-06 3:34
memberAndreGr14-Nov-06 3:34 
Questionhow to get selected filename Pin
cskurdal1-Sep-06 8:25
membercskurdal1-Sep-06 8:25 
GeneralWhy you didn't post the whole project ?! Pin
mark_md427-Jul-06 23:55
membermark_md427-Jul-06 23:55 
GeneralRe: Why you didn't post the whole project ?! Pin
Jonathan Gauthier30-Jul-06 0:49
memberJonathan Gauthier30-Jul-06 0:49 
QuestionHidden Folders? Pin
Daniel Schaffer23-Jan-06 5:29
memberDaniel Schaffer23-Jan-06 5:29 
AnswerRe: Hidden Folders? Pin
Jos Branders31-Oct-09 7:52
memberJos Branders31-Oct-09 7:52 
GeneralAdd sorting capability Pin
DemonFox5-Sep-05 1:28
memberDemonFox5-Sep-05 1:28 
GeneralRe: Add sorting capability Pin
Mark Johnson24-Aug-07 21:00
memberMark Johnson24-Aug-07 21:00 
GeneralProblem finding bug.. Pin
dermoultam16-Aug-05 20:55
memberdermoultam16-Aug-05 20:55 
Generaladd context (right-click) menu with delete file, rename file, create directory, delete directory Pin
Kenneth Scott30-Jun-05 18:20
sussKenneth Scott30-Jun-05 18:20 
GeneralAdd . (currentfolder) to control and also add missing files Pin
Kenneth Scott30-Jun-05 18:05
sussKenneth Scott30-Jun-05 18:05 
GeneralRe: Add . (currentfolder) to control and also add missing files Pin
Kenneth Scott2-Jul-05 14:17
sussKenneth Scott2-Jul-05 14:17 
GeneralException during browsing of &quot;My Network Places&quot; Pin
om31-May-05 23:26
memberom31-May-05 23:26 
GeneralHELP - Don't show ZIP and PDF files ! Pin
Le_MuLoT8-Apr-05 7:43
memberLe_MuLoT8-Apr-05 7:43 
GeneralRe: HELP - Don't show ZIP and PDF files ! Pin
Le_MuLoT15-Sep-05 11:38
memberLe_MuLoT15-Sep-05 11:38 
GeneralExecuting Selected Files Pin
Le_MuLoT8-Apr-05 4:36
memberLe_MuLoT8-Apr-05 4:36 
GeneralAny one implemented this in vb.net Pin
Vanjari22-Sep-04 4:26
sussVanjari22-Sep-04 4:26 
GeneralRe: Any one implemented this in vb.net Pin
eelisMX23-Sep-04 5:40
membereelisMX23-Sep-04 5:40 
Generalvisual studio .net 2005 beta Pin
Anonymous11-Sep-04 17:16
sussAnonymous11-Sep-04 17:16 
GeneralRe: visual studio .net 2005 beta Pin
WilsonProgramming8-Nov-04 14:41
memberWilsonProgramming8-Nov-04 14:41 
GeneralRe: visual studio .net 2005 beta Pin
WilsonProgramming9-Nov-04 11:43
memberWilsonProgramming9-Nov-04 11:43 
GeneralRe: visual studio .net 2005 beta Pin
zarrandreas13-Feb-06 12:30
memberzarrandreas13-Feb-06 12:30 
GeneralRe: visual studio .net 2005 beta Pin
lcalabrese12-Dec-08 2:24
memberlcalabrese12-Dec-08 2:24 
Generalimplementing Pin
nicbiondi3-Aug-04 8:14
membernicbiondi3-Aug-04 8:14 
GeneralRe: implementing Pin
hollandridderkerk15-Aug-04 22:00
memberhollandridderkerk15-Aug-04 22:00 
GeneralRe: implementing Pin
nicbiondi16-Aug-04 7:31
membernicbiondi16-Aug-04 7:31 
GeneralBase Folder Pin
hollandridderkerk5-Jul-04 5:57
memberhollandridderkerk5-Jul-04 5:57 
GeneralRe: Base Folder Pin
Chris Hambleton18-Aug-04 8:47
memberChris Hambleton18-Aug-04 8:47 
GeneralUsing the mouse to select items. Pin
mpalle5-May-04 11:01
membermpalle5-May-04 11:01 
GeneralError message Pin
bunkscene3-Jan-04 16:34
memberbunkscene3-Jan-04 16:34 
GeneralRe: Error message Pin
Jonathan Gauthier4-Jan-04 4:04
memberJonathan Gauthier4-Jan-04 4:04 
GeneralRe: Error message Pin
Le_MuLoT8-Apr-05 6:45
memberLe_MuLoT8-Apr-05 6:45 
QuestionCan this be used in a Console App? How? Pin
Anonymous19-Dec-03 8:32
sussAnonymous19-Dec-03 8:32 
AnswerRe: Can this be used in a Console App? How? Pin
Jonathan Gauthier4-Jan-04 4:05
memberJonathan Gauthier4-Jan-04 4:05 
GeneralSorting Pin
ryanul12-Dec-03 12:31
memberryanul12-Dec-03 12:31 
QuestionNo Draging? Pin
sfdkuhudkj13-Nov-03 13:14
membersfdkuhudkj13-Nov-03 13:14 
AnswerRe: No Draging? Pin
Jonathan Gauthier4-Jan-04 4:07
memberJonathan Gauthier4-Jan-04 4:07 
GeneralGreat Control Pin
zorbal23-Oct-03 23:11
memberzorbal23-Oct-03 23:11 
GeneralRe: Great Control Pin
Jonathan Gauthier24-Oct-03 17:09
memberJonathan Gauthier24-Oct-03 17:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150428.2 | Last Updated 25 Sep 2003
Article Copyright 2003 by Jonathan Gauthier
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid