-
Hey, if I use:
Code:
listview1.ListItems(5).Selected = True
the 5th item is selected, but the code in the click or itemclick isn't triggered like it is if I actually click on the 5th item. So what event is fired when I select the item through code??
Thanks!
-
-
But other controls like a combo or list fire when I select an index through code. Something MS didn't give us with the listview (in report view)?? :(
-
Is there a way of dynamically calling the event -- something like:
Code:
Dim z As Variant
z = frmMain.lVwEmplyCatg_Click
Call z
where I would pass z. This is a module to which I pass the control so I don't want to hard-code any values. Thanks.
-
No, there's addressof but i think you can't use it with a VB calls.
Why do you need it to be dynamic? you could just call an event after you use the code .Selected=True
-
addressof would apply if I wanted to subclass and read the window messages without the help of vb's control events (plus catch messages that vb doesn't provide to you). I'm using a sub that's modular so that the code doesn't have to be repeated later and modified. If I put in a hard-coded control name, I'll have to revise it for each listview calling it. Thanks.