Solved

Treeview / Listview - Viewing Files in Drives

Posted on 1997-07-09
2
223 Views
Last Modified: 2009-07-29
Warrning! i am new to VB and have just started on vb5 (First project).

i want to build a project in which i can browse the desktop, local drives, network drives and others and see all the available files in those drives.  

i have used vb5 wizzard and got the basic code but every where it says 'To Do code...

i also checked out the sample by microsoft for biblo but my problem is file handeling (for this project) not database handeling.  (when time comes i will clearfy the database problem).

who ever answers please give me all the possible code commands with little examples ( i am a quick learner) just give me a jump start.

ps: don't forget to give me examples.  i am willing to raise the points u want me to.
0
Comment
Question by:msali
2 Comments
 
LVL 1

Expert Comment

by:mirkus
ID: 1428162
For see your PC, and your local drive and network you must fill 3 control in your form.
1 Drive control
1 File Control
1 Directory control

Then you must write a code to refresh control for your Choose
In Form_Load event you force Dirve for you c:

           Drive1.Drive="c:\"
           Dir1.Path=Drive1.Drive
           File1.Path =Dir1.Path

Then you must  write code for you click on Control so in

Private Sub Drive1_Change()
    Dir1.Path =Dirve1.Drive
end sub

Private Sub Dir1_Change()
   File1.Path=Dir1.Path
end Sub

File1 , Drive1 , Dir1 is a generic name of your control.

I hope this is what  you'll find

Good luck......            Mirkus

0
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1428164
I can't write your useage of Treeview and ListView controls for you, there are too many decisions to make regarding how they look and feel, and what functionality you add to them.  The VB help system, along with examples and a few frustrating weeks should make you reasonably disgusted with them as controls for your app.  But, "Basically",  you have to populate and link their cross useage yourself.  Here's a few hints to get you started.

1) you can use your existing Drive, File and Directory controls to do the lookup work.  Keep them invisible, feed them the right properties, and steal their contents (items) for your own Treeview/Listview controls.

2) You have to refill the ListView on the NodeCLick event of your treeview.  To make it really like Explorer, you also have to go back to the related entry in your TreeView when a directory is opened in your ListView.  You can retain these back & forth pointers in the .tag property of each item in the controls. You have to use only string data in this property, but you can save the respective item keys, and other info as well here.  Use some kind of delimiter (Underline?) to separate individual items.

3) Warning: the .children, .Parent, .Next/First/Last sibling navigation in Treeview can be a real pain for you.

4)generating a unique key for each item is critical on the .AddItem method.  You have to have errorhandling to catch dup keys, you're better off coding ahead to make sure they are unique when you add.

5) Keep in mind that the Treeview control had the most bugs of any control when first released in VB4.0, and don't expect everything to work as advertised (as if anything is that way on any control!:))

6) on the other hand, you get to set each icon on every item in each control, and you can then examine the large or smallicon property to change the behaviour of your app respective to tye of item selected, etc.

7) Let me say that it is not a trivial task, that's why there are alternative methods and other controls provided to achieve the same functionality.    
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now