QA Stooge Posted April 20, 2006 Share Posted April 20, 2006 See my attached screenshot. Notice that there are 3 ListView controls. Notice that 2 are populated with LVItem controls. Notice that for each LV control there is a LVItem selected. Notice that there is one LVItem which was last clicked (hilighted blue one on the right) and one which was selected sometime previously. Now for the question. How does AutoIt know which one was last clicked? ... a computer user (you and I) can just tell visually. But the computer has a different method of reliable distinction. Anyone know how to get the equivalent of something like a "GUICtrlGetLastSelected()" function? Link to comment Share on other sites More sharing options...
Shao Posted April 20, 2006 Share Posted April 20, 2006 Hi, Well, I think you should use some array_variable like : array_item1[$number] as an array-variable used for the first listview array_item3[$number] as an array-variable used for the third listview $selected_indice = _GUICtrlListViewGetSelectedIndices() let you identify which item is selected through its indice of insertion in the listview $selected_text = _GUICtrlListViewGetItemText() let you retrieves some or all of a list-view item. Link to comment Share on other sites More sharing options...
AutoChris Posted April 25, 2006 Share Posted April 25, 2006 Yeah... what Shao said. But since you just want the last one, you can put it in a single variable. Every ListViewItem will have an ID and that ID will go into your variable every time it is pressed. Link to comment Share on other sites More sharing options...
QA Stooge Posted April 25, 2006 Author Share Posted April 25, 2006 Hi, Well, I think you should use some array_variable like : array_item1[$number] as an array-variable used for the first listview array_item3[$number] as an array-variable used for the third listview $selected_indice = _GUICtrlListViewGetSelectedIndices() let you identify which item is selected through its indice of insertion in the listview $selected_text = _GUICtrlListViewGetItemText() let you retrieves some or all of a list-view item.Actually, I didn't use your method, but what you said just triggered an epiphany that worked beautifully... - set up an array of size equal to the number of ListViews. - each element in the array has the CtrlID of the LVI selected in each ListView. - if an element changes, update ths info display window. Even if I didn't use your method, just your train of thought helped me a bundle. Thanks! Link to comment Share on other sites More sharing options...
Shao Posted April 25, 2006 Share Posted April 25, 2006 Well, I'm happy to have helpt you in a way. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now