Jump to content

Distinguishing Selected Controls


 Share

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...