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
			
			
									
									
						ListIconGadget() Scrolling
Re: ListIconGadget() Scrolling
Just do this to select and make visible the last item:
			
			
									
									Code: Select all
SetGadgetState(#gad,CountGadgetItems(#gad)-1)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
						"PureBasic won't be object oriented, period" - Fred.
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
To ensure an item is visible :
ListViewGadget SendMessage_(GadgetID(#ListView), #LB_SETTOPINDEX, Item, 0)
ListIconGadget SendMessage_(GadgetID(#ListIcon), #LVM_ENSUREVISIBLE, Item, 0)
			
			
									
									ListViewGadget SendMessage_(GadgetID(#ListView), #LB_SETTOPINDEX, Item, 0)
ListIconGadget SendMessage_(GadgetID(#ListIcon), #LVM_ENSUREVISIBLE, Item, 0)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						