In the following code - it updates a listview with the item select from the treeview. It adds the correct name (.Text = oTree.SelectedItem) but I cannot figure out the property tag for the image file.
Right now I am using a default image for all items (.SmallIcon = "Network_Icon")
.SmallIcon should reference the image from .Text
Any ideas??
=========================================================
Private Sub ListView_OLEDragDrop(Data As Object, Effect As Long, _
Button As Integer, Shift As Integer, x As Single, y As Single)
Dim oTree As TreeView
Dim mListItem As ListItem
Set oTree = Me!TreeView.Object
'MsgBox oTree.SelectedItem
'ListView.ListItems.Clear
Set mListItem = ListView.ListItems.Add()
With mListItem
.Text = oTree.SelectedItem
.SmallIcon = "Network_Icon"
End With
End Sub
=========================================================
Right now I am using a default image for all items (.SmallIcon = "Network_Icon")
.SmallIcon should reference the image from .Text
Any ideas??
=========================================================
Private Sub ListView_OLEDragDrop(Data As Object, Effect As Long, _
Button As Integer, Shift As Integer, x As Single, y As Single)
Dim oTree As TreeView
Dim mListItem As ListItem
Set oTree = Me!TreeView.Object
'MsgBox oTree.SelectedItem
'ListView.ListItems.Clear
Set mListItem = ListView.ListItems.Add()
With mListItem
.Text = oTree.SelectedItem
.SmallIcon = "Network_Icon"
End With
End Sub
=========================================================