I'm just learning VB with the 2008 express edition.
I'm trying to create a program that uses 3 list boxes. The first contains a list of products. After a search is preformed the second list box displays the products found. This is pretty simple, basic array stuff. My problem is moving items from the second list box into a third list box to purchase the product. I think I need to change the index numbers of the stuff I move into list box 3 because when I preform calculations with the stuff in list box 3, it seems to answer like its using the index numbers in list box1. So, how do you change the index numbers when you change list boxes?

Recommended Answers

All 3 Replies

You question should have been posted in vb.net section of the forum.

Does your application connects to any database for the list of items ?

Hi,
Suppose you have a listbox named 'lsbProducts', another one that is called 'lsbPurchased' and a button named 'btnTransfer'. In order to "transfer" item between the listboxes, you need to write the code below..

On button Click:

Dim temp as ListItem = lsbProducts.SelectedItem
 lsbPurchased.Items.Add(temp)

I hope that this is what you want...

Cheers :D

You question should have been posted in vb.net section of the forum.

Does your application connects to any database for the list of items ?

The items are added with text boxes and buttons and saved into a data file with a steam writer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.