Making ListIconGadget visible automatically

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

Hi folks. I have a ListIconGadget full of items. The window is only a few inches high in my form and a lot of items are below the visible window.

When I search for objects (search and activate routine) and set them active so they are highlighted, is there any way to make the window scroll up automatically so the found and highlighted item is shown in the visible portion of the window?

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Hey Fangs,

get the handle of your ListIconGadget:
hList=ListIconGadget(#gadget,10,10,400,150,"Test",100)

Now if you have say 50 items in the gadget and you want to focus on item 17 for example...
SendMessage_(hList,#LVM_ENSUREVISIBLE,17,0)
SetGadgetState(#gadget,17)

The SendMessage will move this item into view and the SetGadgetState will highlight it :)




Edited by - paul on 11 May 2002 08:15:00
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Hey Fangs,

get the handle of your ListIconGadget:
hList=ListIconGadget(#gadget,10,10,400,150,"Test",100)

Now if you have say 50 items in the gadget and you want to focus on item 17 for example...
SendMessage_(hList,#LVM_ENSUREVISIBLE,17,0)
SetGadgetState(#gadget,17)

The SendMessage will move this item into view and the SetGadgetState will highlight it :)

Edited by - paul on 11 May 2002 08:15:00
Ahh, you little beauty, got it all stuffed into place and working. Send the bill to my daughter :):)

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

I'm amazed what knowledge some of you have stored in the pocket.
Great to know that


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
I'm amazed what knowledge some of you have stored in the pocket.
Great to know that


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
You know, for someone who isn't dead, Paul is an amazing living legend:)

Fangles
Post Reply