Jump to content

Recommended Posts

Posted

Hello, I have an application populating a ListView. It iterates through a 2D array, adds the item to the ListView using GUICtrlCreateListViewItem(), and saves the returned controlID back into the 2D array. I then reference this controlID elsewhere in the application to read and modify the checkbox state of the item in the ListView.

I'd like to transition to populating the ListView with _GUICtrlListView_AddItem() or _GUICtrlListView_AddArray() but if an index (the position of the item in the ListView?) is returned by these functions, how do I keep track of the items relative to the original array when the item positions change, such as when a column header is clicked for sorting?

Posted

After digging through the Help file more, I found the following functions which look like they'll solve my question.

_GUICtrlListView_MapIndexToID
_GUICtrlListView_MapIDToIndex

A good example of these functions in use found here.

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
  • Recently Browsing   0 members

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