I need to add an image (icon) to the treeview from VB6 using vb.NET.
I do this in an procedure (formatNode) where I pass the treeview by reference.
But I always get errors. Can somebody help me with this.
Code:
Private Sub formatNode(ByRef control As AxMSComctlLib.AxTreeView)
With control.Nodes.Item(myNodeCount) 'grab the current node
.Expanded = True 'expand the node
'.Image = ????? (please help !!!!)
End With
End Sub
Last edited by R@emdonck; Dec 16th, 2002 at 11:44 AM.
I tried this, but all I got was another error ...
"Exception from HRESULT: 0x800A8B1A."
Code:
Private Sub formatNode(ByRef control As AxMSComctlLib.AxTreeView, ByRef Images As AxMSComctlLib.AxImageList)
Try
control.ImageList = Images
With control.Nodes.Item(myNodeCount) 'grab the current node
.Expanded = True 'expand the node
.Image = Images.ListImages.Item(0)
End With
Catch
Dim mes As String
mes = Err.Description
MsgBox(mes)
End Try
End Sub