1 Attachment(s)
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:
Private Sub initializeTree()
tvwItems.ImageList = imgList
Dim nodClass As Node
Dim nodTitle As Node
Dim nodSubClass As Node
tvwItems.LineStyle = tvwRootLines
tvwItems.Nodes.Clear
'Initialize the recordsets
Set rsClass = New ADODB.Recordset
Set rsTitle = New ADODB.Recordset
'Open the Class recordset
strSQLClass = "SELECT id, classification FROM tblClassification ORDER BY classification"
rsClass.Open strSQLClass, conTree, adOpenStatic, adLockOptimistic
'set node for treeview
If rsClass.RecordCount > 0 Then
While Not rsClass.EOF
Set nodClass = tvwItems.Nodes.Add(, , (rsClass.Fields("classification")), (rsClass.Fields("classification")), 1)
'Opens the recordset for Title
strSQLTitle = "SELECT id, uniquekey, title, classification, code, dateadded FROM tblSnipplets WHERE classification = '" & (rsClass.Fields("classification")) & "' ORDER BY title"
rsTitle.Open strSQLTitle, conTree, adOpenStatic, adLockOptimistic
'set node for treeview
If rsTitle.RecordCount > 0 Then
While Not rsTitle.EOF
Set nodTitle = tvwItems.Nodes.Add((rsClass.Fields("classification")), tvwChild, UniqueKey, (rsTitle.Fields("title")), 3)
' Set nodTitle = tvwItems.Nodes.Add
nodTitle.Tag = rsTitle.Fields("Id").Value
rsTitle.MoveNext
DoEvents
Wend
End If
rsTitle.Close
rsClass.MoveNext
DoEvents
Wend
End If
rsClass.Close
End Sub