In a dropdown list I have a few items. Can I, when I select an item, get the position of that item in the list as a number?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using a list or combo box,
ListIndexwould seem to be what you are after.VB Help for
ListIndexproperty: Returns or sets the index number of the currently selected item in a list box or combo box. Read/write Long. Remarks. You cannot use this property with multiselect list boxes.If nothing is selected,
ListIndex‘s value is-1. If memory serves, it is a zero based index.ListIndexcannot be set at design time so it is not listed in the properties window.When entering your code, type the list box name then dot and the editor displays all the available properties. Scroll down the list, note any that look interesting, then look them up.