Ciao.
- Per prima cosa ti devi creare la ImageList e popolarla con le icone che ti servono (penso che l'hai già fatto)
- associa l'ImageList creata alla proprietà ImageList della treeview
- ricordati per ogni icona l'indice a base 0 che occupa nella imagelist.
poi usa questo codice (ho messo solo la parte del for each) sostituendo al posto dei puntini l'indice dell'icona da visualizzare
For Each Database As DataRow In DS.Tables("Database").Rows
dim nodoDB as new Treenode()
nodoDB.text = Database("TABLE_SCHEMA").ToString()
nodoDB.imageindex = ....
Dim nodoGRP as new TreeNode()
nodoGRP.Text = "Tabelle"
nodoGRP.imageindex = ....
For Each Tabelle As DataRow In DS.Tables("Tabelle").Rows
If Tabelle("TABLE_SCHEMA") = Database("TABLE_SCHEMA") Then
dim ntb as new treenode()
ntb.text = Tabelle("TABLE_NAME")
ntb.imageindex = ...
nodoGRP.nodes.add(ntb)
End If
Next
nodoDB.nodes.add(nodoGRP)
nodoGRP = new TreeNode()
nodoGRP.Text = "Routine"
nodoGRP.imageindex = ....
For Each Routine As DataRow In DS.Tables("Routine").Rows
If Routine("ROUTINE_SCHEMA") = Database("TABLE_SCHEMA") Then
dim nrt as new treenode()
nrt.text = Routine("ROUTINE_NAME").tostring()
nrt.imageindex = ....
nodoGRP.nodes.add(nrt)
End If
Next
nodoDB.nodes.add(nodoGRP)
TreeView1.nodes.add(nodoDB)
Next
Cristian Barca