Re: ListView item addressing
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Jan 13, 2006
- 522 views
Antonio Alessi wrote: > > Using the win32lib I learn that: > > ".. each item in a list view has a unique ID number.. no two listview items > have the same ID value, regardless of which listview it they are in. The item > ID is not the same as its index value. The index value is where in a list view > the item is positioned. The ID is used as a way to identify an item without > referring to its column values or position. When you add an item using > addLVItem, > you get the item's ID returned." > > This seems quite clear, but I cannot find any other reference to this ID > parameter: > all the described ListView routines seem to make use or refer to the row > number > only. > > Somebody knows a direct mode to access or update a value into a ListView when > the rows order has been changed? I believe that whenever refering to a ListView item, you should use the item number. There are many routines in Win32Lib that can be used for many different control types, and most of the others (ListBox, ComboBox, etc) use the position of the item. Most of those routines predate the addition of ListViews to Win32Lib. Windows treats ListViews differently, however, and therefore so does Win32Lib. Part of the reason is that ListView items can contain more information than the simple text that a ListBox has (you have columns, checkboxes, icons and other user defined data). Matt Lewis