Shoutbox

[Question] Scripted LstView scrolling - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Question] Scripted LstView scrolling (/showthread.php?tid=79892)

[Question] Scripted LstView scrolling by mynetx on 12-10-2007 at 08:15 PM

There's a Plus! Window.
In it, there's a ListView.
The ListView has a height set to show 20 entries, in Report Mode.
The script adds 30 entries to the list, so the last 10 ones are outside the viewport, and a vertical Y-scrollbar is shown.
Now the script changes entry #25, outside the viewport, using LstView_SetItemText.
How can the script make the ListView scroll down to move that entry into the viewport?
LstView_SetSelectedState will highlight or mark the row, but won't move it into the viewport.

Any help appreciated,


RE: [Question] Scripted LstView scrolling by Eljay on 12-10-2007 at 08:22 PM

You can send LVM_ENSUREVISIBLE to the ListViewControl using PlusWnd.SendControlMessage ;)


RE: [Question] Scripted LstView scrolling by mynetx on 12-10-2007 at 08:33 PM

Thank you very much. Altogether with

code:
var LVM_FIRST = 4096;
var LVM_ENSUREVISIBLE = LVM_FIRST  + 19;
it works now perfectly.