Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining which is the listbox row JUST selected in a multi-select l 2

Status
Not open for further replies.

juschuma

Programmer
Oct 23, 2002
18
0
0
US
I have a multi-select listbox. On the listbox_click event I want to do an If statement to see if a particular row was the one most recently selected.

Is that possible? Right now, I can only figure out how to tell if it is selected at all, not if it's the one most recently clicked.

Thanks.
 
Hi!

The only thing I can think of is to declare a form level or static array to store the selected rows. Then you can run a comparison and the selected row that isn't in the array will be the most recently selected.

hth
Jeff Bridgham
bridgham@purdue.edu
 
The ListIndex property of the list box will tell you which row is currently selected. ListIndex equals 0 to the number of rows-1. For examle, on the OnClick event of the list box, examine ListIndex.

Msgbox lstYourYourListBox.ListIndex
 
Hi!

Good call FancyPrairie, I thought that the listindex was unavailable with the multiselect. But you can access just like you say. Learned something new today!

Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top