help with coding for a listbox object

flashy_lord

Member
Joined
Sep 3, 2010
Messages
5
Location
wisconsin
Programming Experience
Beginner
hello guys

The application I am trying to create seems pretty easy and only requires a few lines of code, there are two listboxes, one contains a list of items, the other one is empty, additional;y there are two buttons one called "add items" which when clicked, it add the item to the other listbox, the other button in called "remove item" which removes the selected item from the second listbox and inserts it back to the first listbox. there is another button that when clicked, it goes into a for next loop, grabbing all the items in the second listbox, and it should lastly add the items' price together and display them in the textbox, for that I nested a case select statement inside the for loop.
I attached the solution in this thread for better understanding of what I am trying to accomplish here.

any ideas, suggestions and help will be greatly appreciated and gratified

thanks guys

this is a code overview of what I want to do
VB.NET:
Dim min, max As Integer
        Dim x As Integer
        Dim price As Integer
        Dim totalprice As Integer


        min = 0
        max = selectionListBox.Items.Count

        For x = min To max Step 1
            Select Case selectionListBox.Items.Item(x)
                Case "cell phone"
                    price = 800
                Case "GPS"
                    price = 500
                Case "DVD player"
                    price = 900
            End Select
            totalprice = +price
        Next

        totalTextBox.Text = price
 

Attachments

  • 2listboxes.zip
    14.1 KB · Views: 23
Last edited by a moderator:
Back
Top