Results 1 to 6 of 6

Thread: Listview Event

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    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!
    Wade

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    None
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    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)??
    Wade

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    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.
    Wade

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    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.
    Wade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width