CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Location
    Moscow, Russia
    Posts
    7

    Selection changed in ListView

    Is there any way to handle selection changing between rows in a ListView control?
    I couldn't find any proper event. I need one that corresponds to LVN_ITEMCHANGED notification or something like that.


  2. #2
    Join Date
    Jul 2000
    Posts
    124

    Re: Selection changed in ListView

    I think you can use the click event.

    HTH,
    Erica


  3. #3
    Join Date
    Aug 2001
    Location
    Moscow, Russia
    Posts
    7

    Re: Click Event

    That's what I did first. But click event is genereated only for mouse clicks, while selection can be also changed by a keydown message: vbKeyUp, vbKeyDown, vbKeyPageUp, vbKeyPageDown, vbKeyHome, vbKeyEnd.
    I thought of handling KeyDown event as well, but in a KeyDown event handler I have only old selection and I have to calculate new selected item manually for each case of a key code. It is kind of silly as in Windows-generated LVN_ITEMCHANGED notification I already have all the necessary info. But I don't know how to handle Windows messages from VB...


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

Featured