Results 1 to 2 of 2

Thread: Treeview Indent [Resolved]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Location
    Georgia
    Posts
    32

    Treeview Indent [Resolved]

    I have the following code and it works fine, but my parent node
    is indented about an inch from the left side. How can make
    the parent node closer to the left side? I have also attached a
    screen shot.

    VB Code:
    1. Private Sub initializeTree()
    2.     tvwItems.ImageList = imgList
    3.    
    4.     Dim nodClass As Node
    5.     Dim nodTitle As Node
    6.     Dim nodSubClass As Node
    7.    
    8.     tvwItems.LineStyle = tvwRootLines
    9.     tvwItems.Nodes.Clear
    10.    
    11.     'Initialize the recordsets
    12.     Set rsClass = New ADODB.Recordset
    13.     Set rsTitle = New ADODB.Recordset
    14.  
    15.     'Open the Class recordset
    16.     strSQLClass = "SELECT id, classification FROM tblClassification ORDER BY classification"
    17.     rsClass.Open strSQLClass, conTree, adOpenStatic, adLockOptimistic
    18.    
    19.     'set node for treeview
    20.     If rsClass.RecordCount > 0 Then
    21.         While Not rsClass.EOF
    22.             Set nodClass = tvwItems.Nodes.Add(, , (rsClass.Fields("classification")), (rsClass.Fields("classification")), 1)
    23.  
    24.             'Opens the recordset for Title
    25.             strSQLTitle = "SELECT id, uniquekey, title, classification, code, dateadded FROM tblSnipplets WHERE classification = '" & (rsClass.Fields("classification")) & "' ORDER BY title"
    26.             rsTitle.Open strSQLTitle, conTree, adOpenStatic, adLockOptimistic
    27.            
    28.             'set node for treeview
    29.             If rsTitle.RecordCount > 0 Then
    30.                 While Not rsTitle.EOF
    31.                     Set nodTitle = tvwItems.Nodes.Add((rsClass.Fields("classification")), tvwChild, UniqueKey, (rsTitle.Fields("title")), 3)
    32.                   '  Set nodTitle = tvwItems.Nodes.Add
    33.                    
    34.                     nodTitle.Tag = rsTitle.Fields("Id").Value
    35.                     rsTitle.MoveNext
    36.                     DoEvents
    37.                 Wend
    38.             End If
    39.             rsTitle.Close
    40.            
    41.             rsClass.MoveNext
    42.             DoEvents
    43.         Wend
    44.     End If
    45.     rsClass.Close
    46. End Sub
    Attached Images Attached Images  
    Last edited by odamsr; Jun 1st, 2004 at 08:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width