Page 1 of 1

ListIconGadget() Scrolling

Posted: Fri Aug 12, 2005 10:51 am
by RichardL
When I add strings to a ListViewgadget() and must ensure the last item is visible I use this code:


AddGadgetItem(3,-1,"Rx: "+String$)
SendMessage_(GadgetID(3), #LB_SETTOPINDEX, CountGadgetItems(3)-1, 0)


It does not work with a ListIconGadget(), probaly because the constant #LB_SETTOPINDEX is not right.

Please, can anyone help with the proper value?

Thanks

Re: ListIconGadget() Scrolling

Posted: Fri Aug 12, 2005 12:21 pm
by PB
Just do this to select and make visible the last item:

Code: Select all

SetGadgetState(#gad,CountGadgetItems(#gad)-1)

Posted: Fri Aug 12, 2005 12:33 pm
by gnozal
To ensure an item is visible :

ListViewGadget SendMessage_(GadgetID(#ListView), #LB_SETTOPINDEX, Item, 0)

ListIconGadget SendMessage_(GadgetID(#ListIcon), #LVM_ENSUREVISIBLE, Item, 0)