1. RE: ListViews In Reverse
- Posted by Jonas Temple <jktemple at yhti.net> Jul 27, 2001
- 402 views
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
2. RE: ListViews In Reverse
- Posted by Virtual B <behaviorself at netzero.net> Jul 29, 2001
- 380 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 > > > > > > > > > > >
3. RE: ListViews In Reverse
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 29, 2001
- 405 views
> I was wondering if anyone knew a way to make a ListView add each new > line to the bottom instead of putting each new item at the top (or > possibly to keep things in numerical order according to what > is in the first column...?). This is "fixed" in the next version. There is a new routine that lets you specify where you want the new item added. Hopefully there are some major speed ups too. Not been benchmarked yet. ----------- cheers, Derek Parnell Senior Design Engineer Global Technology Australasia Ltd dparnell at glotec.com.au --------------------- confidential information intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient of this message you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error please notify the sender immediately. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of Global Technology Australasia Limited.