What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » GetCurSel and SetCurSel with ListViewControl...

GetCurSel and SetCurSel with ListViewControl...
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: GetCurSel and SetCurSel with ListViewControl...
Because a LstView Control can have many selected at a time you will have to iterate through the options.  You actually check a single item rather than checking for which element is selected.  You can do something like the following code though....

code:
[...]
var SelectedState = new Array();
var count = PlusWnd.LstView_GetCount("ControlId");
for(i=0;i<count;i++){
    SelectedState[i] = PlusWnd.LstView_GetSelectedState("ControlId",i);
}
[...]


If you have your XML set so that you can only have one selected however just try this....

[code][...]
var count = PlusWnd.LstView_GetCount("ControlId");
for(i=0;i<count;i++){
    if(PlusWnd.LstView_GetSelectedState("ControlId",i)){
        var selected = i;
        break;
    }
}

As for setting one you just have to do it in much the same way as the ListBox except you need to put in the extra boolean variable for selecting or deselecting.
[Image: markee.png]
08-18-2007 12:40 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
GetCurSel and SetCurSel with ListViewControl... - by roflmao456 on 08-17-2007 at 07:25 PM
RE: GetCurSel and SetCurSel with ListViewControl... - by matty on 08-18-2007 at 12:35 AM
RE: GetCurSel and SetCurSel with ListViewControl... - by markee on 08-18-2007 at 12:40 AM
RE: GetCurSel and SetCurSel with ListViewControl... - by roflmao456 on 08-18-2007 at 02:40 AM


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