DataBase


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: DataBase

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    DataBase

    [Originally posted by Murat YESILBAS]

    sorry I can't speak englis very vell
    but ı want using treeview with listview
    only. THANKS

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:DataBase

    [Originally posted by Kumar]

    Hi Murat,

    Herewith I'm Sending a sample code about "Treeview and Listview". Just Open a new VB Project and add Treeview and Listview in a form and copy the below coding and paste in the same form and Run it.
    The result will be as if u click on the treeview all the child items of the selected item will load in the listview.

    example:

    Private Sub Form_Load()
    ''This to Add Items in Treeview
    Dim i%, LastParn%
    With TreeView1
    .Nodes.Add , , "A0", "0"
    For i = 1 To 25
    If i Mod 5 = 0 Or i = 1 Then
    .Nodes.Add "A0", 4, "A" & i, i
    LastParn = i
    Else
    .Nodes.Add "A" & LastParn, 4, "A" & i, i
    End If
    Next
    End With
    End Sub

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    ''This is to Add the child items of selected item in Tree view to List view
    Dim i%
    ListView1.ListItems.Clear
    With TreeView1
    For i = 2 To .Nodes.Count
    If .Nodes(i).Parent.Key = .SelectedItem.Key Then
    ListView1.ListItems.Add , "L" & i, .Nodes(i).Text
    End If
    Next
    End With
    End Sub

    with regards.,
    Kumar.K

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:DataBase

    [Originally posted by Larry Asher]

    That is some crazy code in the previous example. I think it can be much simpler. Go to MSDN on line they have some very good samples of how to use treeview and listview with a database. If you do not speak much english I am pretty such microsoft has a site in your language. Here is a link to resource that I used from the MSDN library when learning about treeview and listview

    http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconlistviewscenario1.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center