|
-
Oct 10th, 2002, 04:12 PM
#1
Thread Starter
Lively Member
ListView - Object not supported
Can anyone explain why I am receiving this error, "Object doesn't support this property or method" when I attempt to retreive a ListView called from a function?
My Code:
Private Sub Form_Load()
ListView1 = getlistview(ListView1)
End Sub
Function getlistview(mylistview As ListView) As ListView
mylistview.ListItems.Add , , "Fred"
mylistview.ListItems.Add , , "Sarah"
mylistview.ListItems.Add , , "Paul"
Set getlistview = mylistview
End Function
Thank You,
-
Oct 10th, 2002, 04:28 PM
#2
I'm not sure, that is wierd maybe its some kind of default property wierdness. Anyway this works:
VB Code:
Private Sub Form_Load()
filllistview ListView1
End Sub
Sub filllistview(ByRef mylistview As ListView)
mylistview.ListItems.Add , , "Fred"
mylistview.ListItems.Add , , "Sarah"
mylistview.ListItems.Add , , "Paul"
End Sub
-
Oct 10th, 2002, 04:38 PM
#3
Thread Starter
Lively Member
Exactly! Discovered same solution. Thanks for your help.
-
Oct 10th, 2002, 04:45 PM
#4
You know what I think it is, you can't set a control to something after its loaded.
-
Oct 10th, 2002, 04:52 PM
#5
Thread Starter
Lively Member
Interesting. But I was able to substitute the ListView with a ListBox and it worked perfectly.
I think ListView is a different animal completley and copying all the properties and data is just not supported.
Again, thanks for your interest
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|