By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,051 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,051 IT Pros & Developers. It's quick & easy.

How to add My Documents to a TreeView

P: n/a
I'm looking at using a TreeView control and can see how to fill in
MyComputer with directory and file names.

But I have no idea of how to include things like My Documents and My Network
Places

Anyone how to do that.
Thanks

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Stuff like My Computer and My Network Places you have to add manually while filling the treeview, as you cannot scan recursively through drives/directories to find them. Mapped network drives can be added as drives, and you can use the FileScriptingObject to determine the type of drive they are and so apply the correct icon (by using the shell to determine the default icon for the specific type of drive). My Documents is a type of "special folder" that is different for each user, so you'll have to add the tree view item and icon manually in your code, determine which user is logged in, then locate the path within Documents and Settings that applies to that particular user's My Documents folder, and remember to open that path when the item is activated. As far as determining attached saved network connections to add to the My Network Places folder, you'll probably have to use the shell for that too. Unless you really want to, I'd download a control or use the Open Directory dialog to do what you want to do, as it gets a little intensive programmatically
Nov 20 '05 #2

P: n/a
> as it gets a little intensive programmatically.

Sure sound like it, but I cut your reply and paseted into my code and am
going to give it a try.

Thanks
Cal
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.