Oleg R
August 13th, 2001, 05:50 AM
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.
ecannizzo
August 13th, 2001, 09:34 AM
I think you can use the click event.
HTH,
Erica
Oleg R
August 14th, 2001, 12:13 AM
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...