Click here to Skip to main content
Licence 
First Posted 11 Mar 2003
Views 47,066
Bookmarked 18 times

File and directory picker control

By | 11 Mar 2003 | Article
A file and directory picker control

Introduction

The classes that come with Visual Studio for picking files and directories work, but they aren't as clean and user friendly as they should be. My FilePickCtrl class is very similar to what Explorer uses for views, but with some slight differences. The following features are supported:

  • Display small or large icons for detected drives
  • Display small or large icons for files and directories
  • Add filemasks to limit display of files
  • Display only directories so the user can only choose a directory
  • Turn on/off the display of the current directory


Small icons for drives and files, with both files and directories being displayed


Large icons for drives and files, with both files and directories being displayed


Small icons for drives and files, with only directories being displayed

Using the code

To add the control to your program, add FilePickCtrl.cpp and FilePickCtrl.h to your project. Drag FilePickCtrlDemo.rc into Resource Editor, expand the Dialog tree, highlight IDD_FILEPICKCTRL_DIALOG, hold down the Ctrl key, drag the dialog into your program's dialog tree, and close the window for FilePickCtrlDemo.rc. Your project should now have a copy of IDD_FILEPICKCTRL_DIALOG in its Resource Editor.

History

  • First revision, February 28, 2003

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

Lee Hamel

Web Developer

United States United States

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
GeneralWroked great for me! PinmemberKingTermite16:24 18 Nov '04  
GeneralWhats wrong with... PinmemberAndreas Saurwein3:11 12 Mar '03  
GeneralRe: Whats wrong with... Pinmembergnk9:16 12 Mar '03  
GeneralRe: Whats wrong with... PinmemberAndreas Saurwein12:15 12 Mar '03  
GeneralRe: Whats wrong with... Pinmembergnk9:35 13 Mar '03  

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
Web04 | 2.5.120517.1 | Last Updated 12 Mar 2003
Article Copyright 2003 by Lee Hamel
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid