Important alert: (current site time 7/16/2013 2:24:17 AM EDT)
 

winzip icon

ucBrowse - Theme-Aware Browse for Folder Control

Email
Submitted on: 10/28/2007 8:58:37 PM
By: TerriTop 
Level: Advanced
User Rating: By 21 Users
Compatibility: VB 6.0
Views: 18900
author picture
 
     ucBrowse - Theme-Aware Browse for Folder Control ucBrowse is a single file, self-subclassed sited (Form Bound) Browse for Folder replacement control which supports customization. Each control supports the following independent properties: Appearance (Flat, 3D), CheckBoxes, FullRowSelect, HasLines, HotTracking, Path, Root and Theme Detection (Auto, Classic, Blue, HomeStead, and Metallic, None). As a bonus, this submission also includes a Theme Aware version of ucPickBox, which is a self-subclassed Theme-Aware control which wraps up the Browse for Folder, Color, SaveAs, Open and Printer dialogs (see PCS ID 63905). So, if your project needs a Browse for Folder functionality while remaining sited on a form, then this control might be just what the doctor ordered. [Update 16Oct07] Added Unicode support for OS >= Win2K, added HideSelection property (Default = True) to remedy focus management issues, added HasButtons property to allow simple line styles. [Update 28Oct07] Added IsFolder and IsFile support, fixed minor bug in QualifyPath which incorrectly added a backslash to file paths (thanks Ruturaj for catching this!). Enjoy!! TerriTop…

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

10/15/2007 5:57:00 AMenmity

tooltiptext does not show properly, it's under the control
(If this comment was disrespectful, please report it.)

 
10/15/2007 7:40:31 AMNorm Cook

Super - 5 from me
(If this comment was disrespectful, please report it.)

 
10/15/2007 9:31:42 AMKenneth Foster

Excellent.Nice job.
(If this comment was disrespectful, please report it.)

 
10/15/2007 11:22:01 AMenmity

how about tri-state checkboxes?
(If this comment was disrespectful, please report it.)

 
10/15/2007 2:26:13 PMTerriTop

Enmity, thanks for the heads up. I'll look into this...just for clarity, do you mean the UserControl tooltips or the BFF? Thanks TerriTop
(If this comment was disrespectful, please report it.)

 
10/16/2007 5:34:35 AMPaul Turcksin

Very nice. When selecting the "controls" folder I got run time error 'Wrong number of arguments ..'
(If this comment was disrespectful, please report it.)

 
10/16/2007 6:11:45 AMRuturaaj

Nice Submission! Actually in the year 2002, I was thrilled to see such type thing demonstrated by Bobo (don't know his real name). If interested, see his submission here at code ID 40007, of course in PSC VB6 section itself. But that's in one module and you've built a nice and easy to include Usercotrol. Thanks for sharing your code!

I understand we're actually using the same Browse For Folder here. But it will be great if you can override BFF's default Right-click context menu with Windows Explorer's context menu for selected item. Also how about adding support for "Show Files"?? We all know this is also possible in BFF dialog. Please let me know your opinion on these suggestions. Thanks! -- Ruturaaj.
(If this comment was disrespectful, please report it.)

 
10/16/2007 9:49:32 AMIan Welch

Excellent. 5 from me.

Some suggestions:
Add HideSelection property (Use TVS_SHOWSELALWAYS (&H20) in SetSysTreeStyle).
Detect if Windows2k or higher and use SHBrowseForFolderW and SHGetPathFromIDListW to enable Unicode return values.

I'll PM you more info.

(If this comment was disrespectful, please report it.)

 
10/16/2007 11:01:43 AMCarles P.V.

Nice. BTW, a still unsolved issue: focus managing. Suggestion: HideSelection property (enabled by default).
(If this comment was disrespectful, please report it.)

 
10/16/2007 9:56:58 PMTerriTop

Paul Turcksin, the issue with "Controls" has been resolved in the current version (v1.0.42). This was an object conflict using the none qualified enum (i.e. ucBrowse1.Controls). To avoid this in the current version the enum has been changed to ControlPanel. Thanks for catching this!! TerriTop
(If this comment was disrespectful, please report it.)

 
10/16/2007 10:05:33 PMTerriTop

Ruturaaj, thanks for the note. The project was originally inspired by Mr. Bobos excellent submission over a year ago. My goal was to build this for a project that I needed this BFF support, but wanted the UserControl object to deal with the mess of handing the setup / teardown, and of course painting with Theme colors. The current version allows for BFF flag support, see the FolderFlag property and simply "Or" the flags as you see fit, just be aware that not all Flags apply (i.e. UseNewUI), but I have included them for completness. As for the context menu...Hmmmm, I need to do more to research on that... TerriTop
(If this comment was disrespectful, please report it.)

 
10/16/2007 10:09:39 PMTerriTop

Ian Welch & Carles P.V., thanks for both of your suggestions. I have implemented the Unicode and HideSelection window style in the current version (v1.0.42). HideSelection is by default "True", but there may still need to be some tweaking on this as it does not seem to "hide" the node selection as I would have anticipated. Cheers TerriTop
(If this comment was disrespectful, please report it.)

 
10/17/2007 10:26:23 AMTerriTop

Just as an FYI, the version cited in the responses to Paul Turcksin, Ruturaaj, Ian Welch, and Carles P.V., the version should have read v1.0.44...sorry for the confusion! TerriTop
(If this comment was disrespectful, please report it.)

 
10/17/2007 10:59:51 AMxpert

BFF in a control !!! Excellent.
Thanks for sharing it.
Please keep on fixing/enhancing it.
o o o o o

(If this comment was disrespectful, please report it.)

 
10/17/2007 7:25:34 PMGary Staunton

Not too bad at all. Would be great if there was an option for Pattern matching on the selected Folder too. Maybe with an Event returning the Path and Pattern count?
5Gs
(If this comment was disrespectful, please report it.)

 
10/18/2007 1:56:55 AMenmity

@TerriTop

sorry answer late, I mean the tooltiptext for each folder, where those folder path(name) is too long(out of the right border of the control), the tooltiptext won't correctly display
(If this comment was disrespectful, please report it.)

 
10/18/2007 7:36:05 AMfancytom

Good job !
but WHY "3D" NOT WORK ??? ===> .ucBrowse1.Appearance = 1
(If this comment was disrespectful, please report it.)

 
10/18/2007 7:50:58 AMfancytom

ROOT PATH HAVE 0~52.
(.ucBrowse1.Root =0~52)

BUT YOU DID NOT HAVE " only ONE HD DRIVE"
FOR example "C:\" OR "D:\"
Beacuse I used to choice one drive form a ComboBox then show only HD likes "c:\" or "E:\" ....
THANKS YOU very much.

(If this comment was disrespectful, please report it.)

 
10/18/2007 10:12:59 AMTerriTop

fancytom, Thanks for the message. I am not sure I understand the request, but if you are looking to use this to display drives only, you might try playing with the FolderFlags property, which can be combined with "Or" opperators between. As for the appearance, you need to set the Theme to "None" or "Classic"....hope this helps!! TerriTop
(If this comment was disrespectful, please report it.)

 
10/19/2007 2:40:07 AMkibe

how can also view files?
i looking anything same as nero burning rom explorer

(If this comment was disrespectful, please report it.)

 
10/22/2007 6:37:18 PMRiccardo Cohen

Good work! 5+
(If this comment was disrespectful, please report it.)

 
10/23/2007 12:05:18 AMTerriTop

Hey Kibe, If you want to see the folders and files using this control, you might try setting the flags for the "FolderFlag" property to the following:

[Object].FolderFlags = BrowseIncludeFiles

where [Object] is the name of your control....Hope this helps, TerriTop
(If this comment was disrespectful, please report it.)

 
10/29/2007 8:42:12 AMMark

Great Job! Thanks for sharing... 5*s
(If this comment was disrespectful, please report it.)

 
10/30/2007 8:27:59 AMSammy

Very very good, Its simply great. 5 from me
(If this comment was disrespectful, please report it.)

 
10/30/2007 12:04:02 PMCarles P.V.

I did not explain clearly (sorry, my bad). In fact I was referring to two diferent things: first one was related to navigation through controls using TAB key, second one was a suggestion itself (related to focus, too :-)
(If this comment was disrespectful, please report it.)

 
1/23/2009 1:28:06 PMTaner

Great submission! How can we filter files, for ex: show only xls files?

Regards
(If this comment was disrespectful, please report it.)

 
1/25/2009 9:54:02 AMTerriTop

Taner, Unfortunely, this control does not provide filtering as you describe. This is because this is a BFF placed on a UserControl via API manipulation and subclassing. If you need this support, you might need to build a just in time FolderTree, but this can be a daunting task ;-) As for further work on this control, I have moved onto .Net technology and do not develop in classic VB6 much more...Good luck in your quest! TerritTop
(If this comment was disrespectful, please report it.)

 
3/24/2009 4:30:44 PMkibe

TerriTop, is it possible save last selected folder in ucPickBox after app exit? and, after running again, check is it path exists, if no, setting ucPickBox to default - "Locate Folder..."
(If this comment was disrespectful, please report it.)

 
3/25/2009 3:37:17 AMkibe

so, problem in ucPickBox was when choose folder, and after that if mouse over on btn then path set to text "Locate Folder..."
(If this comment was disrespectful, please report it.)

 
3/30/2009 10:07:37 AMkibe

must be replaces with:
...
Case [ucFolder]
' Update the Folder PickBox Values
.txtResult.Locked = True
If m_UseDialogText Then
If (m_Path = vbNullString) Or (Left$(m_Path, 3) <> Left$(.txtResult.Text, 3)) Then
.txtResult.Text = m_DialogMsg([ucFolder])
End If
Else
.txtResult.Text = ""
End If
.cmdPick.ToolTipText = m_ToolTipText([ucFolder])
...
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.