RE: ListViews In Reverse
- Posted by Virtual B <behaviorself at netzero.net> Jul 29, 2001
- 379 views
Thanks Jonas and Jason for your helpful suggestions. Much appreciated. And a special thanks to Euman. Your wiseguy remark was very helpful...Really. It made me laugh at first, but then it got me on a different train of thought, which actually led me to a solution. It was pretty simple, really. I just stored the items in the ListView as a sequence, deleted the item I wanted removed, erased the items in the ListView, and reinserted the sequence minus the deleted item. Thanks again to all of you. Virtual B Jason wrote: > To specify the index of a new item when using LVM_INSERTITEM, the > Win32.hlp file says that the iItem member of the LV_ITEM structure > specifies > the index of the new item. > I think I poked in a number such as #FFFF before I called LVM_INSERTITEM > to add items to the end rather than the beginning of the list. > > ----- Original Message ----- > From: Jonas Temple <jktemple at yhti.net> > To: EUforum <EUforum at topica.com> > Sent: Friday, July 27, 2001 1:18 PM > Subject: RE: ListViews In Reverse > > > > > > > > > > Virtual B wrote: > > > Seriously, is this something that just can't be done in a ListView? > > > > Virtual, > > > > The reason your items are shown in the reverse order you loaded them > > into is that Win32Lib uses a literal 0 on the LVM_INSERTITEM message > > sent to the list view. This inserts the item at the beginning of the > > list. The first item you inserted now becomes the second displayed and > > so on. The only way around this is to code the SendMessage calls > > yourself, specifying the item index for insertion. However, doing this > > will break the column sorting built into Win32Lib. For an example of > > how you might do this, try my SQL4Less on the contributions page on the > > RDS web site. > > > > Hope this helps. > > > > Jonas > > > > > > > > > > >