my old code:
how to assign icon inde=1 to the mopnth node, and icon index=2 for each days of month, all during the code fill treeview.
Tks.
Code:
Private Sub FILL_TREEVIEW()
Dim M As Long
Dim D As Long
Dim nodRoot As Node
Dim nodMonth As Node
With Me.TreeView1
.Nodes.Clear
Set Me.TreeView1.ImageList = ImageList1
.LineStyle = tvwRootLines
.Style = tvwTreelinesPlusMinusText
Set nodRoot = .Nodes.Add(Text:=ANNO)
For M = 1 To 12
Set nodMonth = .Nodes.Add(Relative:=nodRoot, _
Relationship:=tvwChild, _
Text:=Format(M, "00") & "-" & UCase(MonthName(M)))
For D = 1 To Day(DateSerial(ANNO, M + 1, 0))
.Nodes.Add Relative:=nodMonth, _
Relationship:=tvwChild, _
Text:=UCase(Format(DateSerial(ANNO, M, D), "dd/mm/yyyy")) & "-" & UCase(Format(DateSerial(ANNO, M, D), "dddd"))
Next D
Next M
End With
End Sub
how to assign icon inde=1 to the mopnth node, and icon index=2 for each days of month, all during the code fill treeview.
Tks.