I have kept the object into a list. I want to iterate them with user click.
Is there any method like list.next()
I have kept the object into a list. I want to iterate them with
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.
The best option is often to just keep a current index stored in a local variable. On each “click”, just increment your index, and use the value in
list[index].You could, potentially, call
list.GetEnumerator()and useIEnumerator.MoveNext(), but this is more likely to cause issues. In particular, if your collection is modified between clicks, you’ll have problems…