|
-
Aug 30th, 2010, 11:02 AM
#1
Thread Starter
Frenzied Member
[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?
-
Aug 30th, 2010, 11:41 PM
#2
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
...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Aug 31st, 2010, 04:11 PM
#3
Thread Starter
Frenzied Member
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...
-
Aug 31st, 2010, 10:20 PM
#4
Thread Starter
Frenzied Member
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..
-
Sep 1st, 2010, 05:35 AM
#5
Re: [VC++] Last Selected Item in ListBox
 Originally Posted by noahssite
I'm not sure about VC++. I'm using VB6
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|