We help IT Professionals succeed at work.

How do I insert values into a listbox on a Windows form using vb.net

Medium Priority
375 Views
Last Modified: 2013-11-25
In a Windows form application, I'm collecting a beginning number and an ending number and I want to iterate through the range and insert each value into a listbox. I'm pretty new to vb.net and would appreciate any help you can provide me.
Comment
Watch Question

Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2009

Commented:
Apologies, line 5 should read:

lstMyNumbers.Items.Add(i)

Author

Commented:
Your right. tostring is not neccessary and I was going to tell you 'Add' is not a member of 'System.Windows.Forms.ListBox'. Adding 'Item' was the key. Thanks for the quick response.
Top Expert 2009

Commented:
Why do you grade a B when you don't first give me a follow-up comment on why this is not completely to your satisfaction? Grading at EE is not like school, instead they follow the 10 points must principle: it's an A unless....

Please reconsider your grade if you agree, or follow-up with an explanation so that I understand where you're coming from: https://www.experts-exchange.com/help.jsp?hi=404


Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.