Click here to Skip to main content
Licence 
First Posted 24 Sep 2003
Views 145,563
Bookmarked 60 times

Implementing a common File system browser with a ListView

By | 24 Sep 2003 | Article
A ListView Control like the one used in Windows Explorer

Sample Image - FileSystemListView.jpg

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

About the Author

Jonathan Gauthier

Architect
CGI
Canada Canada

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 PinmemberCpei19:06 1 Mar '11  
GeneralAdd-in Code to select a default custom Folder on opening Pinmemberkabamaru9:35 13 Dec '10  
QuestionDoesn't seem to work on VS 2005, have any idea why? Pinmembertrogov20:46 11 Dec '07  
AnswerRe: Doesn't seem to work on VS 2005, have any idea why? Pinmembertrogov5:30 17 Dec '07  
QuestionUpgrading To .Net 2.0 PinmemberAndreGr23:45 12 Nov '06  
AnswerRe: Upgrading To .Net 2.0 PinmemberAndreGr2:34 14 Nov '06  
Questionhow to get selected filename Pinmembercskurdal7:25 1 Sep '06  
GeneralWhy you didn't post the whole project ?! Pinmembermark_md422:55 27 Jul '06  
GeneralRe: Why you didn't post the whole project ?! PinmemberJonathan Gauthier23:49 29 Jul '06  
QuestionHidden Folders? PinmemberDaniel Schaffer4:29 23 Jan '06  
AnswerRe: Hidden Folders? PinmemberJos Branders6:52 31 Oct '09  
GeneralAdd sorting capability PinmemberDemonFox0:28 5 Sep '05  
GeneralRe: Add sorting capability PinmemberMark Johnson20:00 24 Aug '07  
GeneralProblem finding bug.. Pinmemberdermoultam19:55 16 Aug '05  
Generaladd context (right-click) menu with delete file, rename file, create directory, delete directory PinsussKenneth Scott17:20 30 Jun '05  
GeneralAdd . (currentfolder) to control and also add missing files PinsussKenneth Scott17:05 30 Jun '05  
GeneralRe: Add . (currentfolder) to control and also add missing files PinsussKenneth Scott13:17 2 Jul '05  
GeneralException during browsing of "My Network Places" Pinmemberom22:26 31 May '05  
GeneralHELP - Don't show ZIP and PDF files ! PinmemberLe_MuLoT6:43 8 Apr '05  
GeneralRe: HELP - Don't show ZIP and PDF files ! PinmemberLe_MuLoT10:38 15 Sep '05  
GeneralExecuting Selected Files PinmemberLe_MuLoT3:36 8 Apr '05  
GeneralAny one implemented this in vb.net PinsussVanjari3:26 22 Sep '04  
GeneralRe: Any one implemented this in vb.net PinmembereelisMX4:40 23 Sep '04  
Generalvisual studio .net 2005 beta PinsussAnonymous16:16 11 Sep '04  
GeneralRe: visual studio .net 2005 beta PinmemberWilsonProgramming13:41 8 Nov '04  

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.

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