ListView vs ListBox and OnselChanged

Started by Jim Short, November 21, 2012, 05:36:59 AM

Previous topic - Next topic

Jim Short

Quoting Fred Tomke: "The advantage of the grid (towards the listview) is that there is a OnSelChanged event to get known when you've changed the selection using the keyboard." How does one get the current item index from ListView highlighted item when scrolling up and down the list with arrow keys? OnSelChanged does this fine in a ListBox.

Jim
Jim Short

Fred Tomke

Hi, Jim,
Unfortunately, there is no OnSelChanged in ListView. You can be sure: I miss it, too :)
I've posted some ideas about changes for selection in listviews here.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jim Short

Fred, Thanks for the link. Is this missing event a limitation of the arx implementing MFC ListView or Windows ListView.
Does key up / down provide a satisfactory means of navigating with the arrow keys?
Do you have an example?
Cheers,
Jim
Jim Short

Fred Tomke

Hi, Jim, at the moment I have no sample, sorry. And it is not satisfiying at all: you must catch OnKeyUp because at the time of OnKeyDown the selection hasn't changed yet (in my experience). Maybe I'm not uptodate.
If I had the knowledge of C++, I would add the event. But I haven't. As a C# programmer I know there is a OnSelChanged event in a listview. But I don't know if the event is available in C++, too.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]