Link to home
Start Free TrialLog in
Avatar of JackW9653
JackW9653Flag for United States of America

asked on

Getting the index of the last item in a listbox

Hello Experts,

I have several listboxes in a Win forms app that get filled from different database tables. I have given the users the ability to add to these lists by entering text into a text box and clicking a command button which does a simple insert and then a select to repopulate the list. The new item will appear at the bottom of the list (the lists are not sorted). What I want to do is highlight the new item as the list is refreshed from the database. I was planning on using the selected index method to highlight it but i need to know the index.

Thanks,

Jack
ASKER CERTIFIED SOLUTION
Avatar of sagacitysolutions
sagacitysolutions
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JackW9653

ASKER

Thanks Guys, that was exactly what I was looking for. Because the answers came within a minute of each other, and were both correct, I thought it only fair to split the points. Jack