ListView Problem

GregSmith

Registered User.
Local time
Today, 08:48
Joined
Feb 22, 2002
Messages
126
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
=========================================================
 
I don't know much (If anything about Treeview) but a stab in the dark:-

Should this:
.SmallIcon = "Network_Icon"
be this:
.SmallIcon.name = "Network_Icon"

???
 
It turned out to be .smallicon = oTree.SelectedItem.Image


Tony Hine said:
I don't know much (If anything about Treeview) but a stab in the dark:-

Should this:
.SmallIcon = "Network_Icon"
be this:
.SmallIcon.name = "Network_Icon"

???
 

Users who are viewing this thread

Back
Top Bottom