What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Thx!] PlusWnd1.LstView_SetSelectedState()

[Thx!] PlusWnd1.LstView_SetSelectedState()
Author: Message:
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. [Thx!] PlusWnd1.LstView_SetSelectedState()
its possible when i use the PlusWnd.LstView_SetSelectedState(...) cmd

the listview automatic scroll down on the select item??

if i select the item 10 i not see the selection, i want to move the scrollbar for see select item

This post was edited on 03-25-2007 at 06:10 AM by Flash.
My script: Psdp
03-24-2007 04:31 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [LittleHelp] PlusWnd1.LstView_SetSelectedState()
It isn't done automatically.

You need to send a message to the listview to let the list jump to the item so it is visible.

This can done by sending the windows message constant LVM_ENSUREVISIBLE to the listview.

where the two parameters are:
- i: The index of the list-view item.
- fPartialOK: A value specifying whether the item must be entirely visible. If this parameter is True, no scrolling occurs if the item is at least partially visible.

Thus:
PlusWnd.SendControlMessage(MyControlId, LVM_ENSUREVISIBLE, i, fPartialOK)

eg:
code:
MyWindow.SendControlMessage("MyListViewID", /* LVM_ENSUREVISIBLE */ 0x1013, 5, False)
this makes that the listview with ID "MyListViewID" on the window object MyWindow will make the 6th item (first item is item index 0) entirly visible.

PS: that  '/* something */'  isn't needed, it is just an inline comment to make it clear what the number stands for.

This post was edited on 03-25-2007 at 01:14 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-25-2007 01:09 AM
Profile PM Find Quote Report
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. RE: [LittleHelp] PlusWnd1.LstView_SetSelectedState()
Thx cookie that work fine ;)
code:
var id = ListViewAddRow(PlusWnd1,'ListSecs', Array('',inc+ ' - ' +p1,p2))
                if (p3 == 1) PlusWnd1.LstView_SetItemIcon('ListSecs', id, "ImgBusy", true);
                if (num == o) {
                    select = 1
                    PlusWnd1.LstView_SetSelectedState('ListSecs',id,true);
                    PlusWnd1.SendControlMessage('ListSecs', /* LVM_ENSUREVISIBLE */ 0x1013, id, false)
                }

This post was edited on 03-25-2007 at 06:10 AM by Flash.
My script: Psdp
03-25-2007 06:09 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On