Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding new item to lsitbox

Status
Not open for further replies.

dazza12345

Programmer
Nov 25, 2005
35
GB
HI all,
Im trying to add a new value to a list box.

Listbox.Items.Add("item");

This line of code above will add a value to a list box, but "item" will be insrted for the value and text field.

How would i go abouts adding a new item into the listbox with different values for the value and text fields?
 
Add a new ListItem e.g.
Code:
myListBox.Items.Insert(0, New ListItem("Select from list...", 0))

As a side note, I notice that although you have asked a few questions on the forums here, you haven't marked any of the answers as valuable, and I can only see one or two acknowledgements of other peoples responses. If you are not getting the answers that you need read FAQ222-2244 to see how to ask better questions. If you are getting the answers you need see FAQ222-2244 to see how to acknowledge the answers given (paragraph 15).

Paragraph 16 of the FAQ explains about this being a two-way forum, to give guidance on answering other peoples questions, as I also notice that you haven't yet made any posts in other peoples threads.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Very well written ca8msm

Also you need to spend some time reading up on objects prior to implementing them into your scheme of things. You only hurt yourself if you do not and to say the least the person that takes up maintaining your code int he future ;-)

MSDN ListView Members


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top