[VC++] Last Selected Item in ListBox
Hello, how do I get the last selected item in a ListBox?
The user is able to select multiple items in the listbox, but I want to know which item the user selected last. I am using ListBox.SelectedItems to get the array of items selected, I thought I could just check the last item in the array, but it doesn't work like that. The last item in the array is not the last item selected. It doesn't add on values to the array, it simply checks off which item has been selected..
I was looking on MSDN and I couldn't find anything.. Does anyone know of a way to do this?
Re: [VC++] Last Selected Item in ListBox
I tried this using VB6. Seems to be working:
Code:
'// VB6 Code
Private Sub List1_Click() '// on clicking
MsgBox List1.ListIndex '// display the Index in a messagebox
End Sub
...:wave:
Re: [VC++] Last Selected Item in ListBox
On a ListBox? There is no property called ListIndex...
I checked this: http://msdn.microsoft.com/en-us/libr...25(VS.60).aspx
Couldn't find anything...
Re: [VC++] Last Selected Item in ListBox
Is there no built in function to do this?
If there isn't I guess I can always compare the currently selected items with the selected items before..
Re: [VC++] Last Selected Item in ListBox
Quote:
Originally Posted by
noahssite
I'm not sure about VC++. I'm using VB6 :)