Link to home
Create AccountLog in
Avatar of ljhodgett
ljhodgett

asked on

How to goto certain value on combobox in vb.net 2005

Hi,

I have a combobox with around 100 entries. I have tried the following code: -

lstProducts.SelectedIndex = Product_Selected

to goto a certain value in the list. Basically I take the position of where it is ie number 42 in the list. run a piece of code that resets the position of the combobox and I want it to go back to position 42. I thought of using a loop until it reaches this position but the problem is everytime it changes the position of the combobox it runs a piece of code. So I don't want to run the code 42 times. How do I make it go straight to position 42.

Hope this makes sense.

Lee
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
lstProducts.SelectedValue = ValueToFInd;