Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Using Treeview  and listview control(VB 6.0)

Posted on 2004-11-01
Medium Priority
Last Modified: 2010-10-05
Hi there,
  i wanted to create a explorer like thing using treeview and listview control, on the left side of the window will have treeview in which all the folders are displaying and on the right side i have the files on the selection of regarding folders from treeview.

Regards & Thanks
Question by:SeanWilliamson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 12461611
You could use Treeview and Listview but VB6 already has controls for file/directory access.

They are DirListBox, FileListBox and DriveListBox and are part of the standard toolbar.

Use these and it will save you a lot of coding.

LVL 28

Expert Comment

ID: 12461907

Accepted Solution

atheekurrahman earned 150 total points
ID: 12470738
first make sure u have microsoft windows common controls 6.0 ticked in the components dialog

Private Sub Form_Load()

With tvwNavigator.Nodes
      .Add , , "Root", "Root node", "Home"                              // Home is the picture name in the imagelist
                                                                                        // if u dont have one give the path of a picture to be displayed
                                                                                        // for the nodes  
      .Add "Root", tvwChild, "AppData", "Appli", "path of pic when node note selected", "path of pic when node note selected"
      .Add "AppData", tvwChild, "Guests", "Guests", "ClosedFolder", "OpenFolder"
      .Add "Guests", tvwChild, "GuestForm", "Guests Form", "Form", "Form"
      .Add "Guests", tvwChild, "OverviewGuests", "Overview - Guests", "Table", "Table"
      .Add "AppData", tvwChild, "Rooms", "Rooms", "ClosedFolder", "OpenFolder"
      .Add "Rooms", tvwChild, "RoomForm", "Rooms Form", "Form", "Form"
      .Add "Rooms", tvwChild, "OverviewRooms", "Overview - Rooms", "Table", "Table"
      .Add "Root", tvwChild, "Reports", "Reports", "ClosedFolder", "OpenFolder"
      .Add "Reports", tvwChild, "CustReport", "Customer Report", "Report", "Report"
      .Add "Root", tvwChild, "UserData", "User Data", "ClosedFolder", "OpenFolder"
      If UserLevel = "Full" Then .Add "UserData", tvwChild, "AddUser", "Add New User", "User", "User"

      .Item("Root").Expanded = True
      .Item("AppData").Expanded = True
   End With
End Sub

Private Sub tvwNavigator_DblClick()
   Select Case tvwNavigator.SelectedItem.Key
      Case "GuestForm"                 // name of the node
      Case "OverviewGuests"
      Case "OverviewRooms"
     End Select
End Sub


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 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