Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / VB / VB.net - how to display directory structure using vb6 treeview control.

Author
Message
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Nov 2005 00:45
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 26th Nov 2005 02:49
Umm, did you put any effort into this? I don't have VB6 installed on this computer, but why don't you just use the directory list control?

re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Nov 2005 03:14
tried this already but i want a tree view that shows files AND folders. additionally i want to know if i must use recursion to set the tree view up or, can i rather set the path of the tree to a directory and let the path seperator sort it out.

re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Nov 2005 03:33 Edited at: 26th Nov 2005 03:34
similar to how netbeans displays filesystems

Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Nov 2005 08:55
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 26th Nov 2005 14:38
Nice find, Phaelax, but he was asking for VB6, not VB.net. The treeview controls are a bit different. From what I understand, you have to go through the Windows API if you want to use a tree view control to show a directory tree.

@Greed, you may be able to find an ActiveX control that already does this. I haven't really searched for one. If all you need is a simple file / folder viewer, you could just use the common dialog control.

re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Nov 2005 19:11
i am trying my hand at an ide, and im trying to make a filesystem browser like the ever so sexy ide netbeans, but I guess im going to have to do it recursively. oh well.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Nov 2005 21:16
I imagine it would involve recursively populating the treeview. Try searching for a directory lister routine in VB6, it's easy to modify it to add treenodes instead of whatever the routine does.

"A book. If u know something why cant u make a kool game or prog.
come on now. A book. I hate books. book is stupid. I know that I need codes but I dont know the codes"
Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2005 19:29
oops, i just saw vb.net in the thread title and assumed. i think i'll just stick to the java threads.


Deadly Night Assassins
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 28th Nov 2005 22:54
speaking of java and the web, would syntax coloring be better done using css and a webbrowser gadget or trickery using richtext?

Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Nov 2005 22:13
I've tried doing syntax highlighting in java using styled documents, and it was a huge headache. I wasn't that familiar with the classes anyway, but still was more work than I expected. I've attached my unfinished editor java project. You can take a look if you want to. I also have a class in there doing line numbering that wasn't implemented into the main project yet.


Deadly Night Assassins

Attachments

Login to view attachments
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 29th Nov 2005 23:54
while we are on the topic, can i draw directly on a richtext control or do i need to make some sort of overlay?

Login to post a reply

Server time is: 2025-05-07 05:00:35
Your offset time is: 2025-05-07 05:00:35