M
Mike
Hey guys trying to learn VB.net. Taking a class and we are working on a
project. I think I might be trying to work farther ahead then I should. But
here is the situation.
I am writing a program to calc the size of a pizza along with toppings to go
on it. I have a combo box with 3 sizes and the price and 2 list boxes, one
with toppings that as you double-click on the item it moves it over to the
second list box.
For example "Medium $8.99"
And then a list box with 5 toppings that are sold for .99 cents each.
I have figured out how to initialize my combo box and list box as follows:
'Initialize combo box
cboSize.Text = "Pizza Size"
cboSize.Items.Add("Medium $8.99")
cboSize.Items.Add("Large $11.99")
cboSize.Items.Add("Gigantic $13.99")
'Initialize list box
lstChoices.Items.Add("Pepperoni")
lstChoices.Items.Add("Sausage")
lstChoices.Items.Add("Ham")
lstChoices.Items.Add("Onions")
lstChoices.Items.Add("Green Peppers")
lstChoices.Items.Add("Black Olives")
My problem is how do you take the item from the combobox turn it into and
integer? For example cboSize.Items.Add("Medium $8.99") = 8.99 Then take and
count the number of toppings from the listbox add them all together and
multiply it by .99 cents?
Not trying to cheat, just need a little help. I can't find anything in the
book up to the chapter we have covered so far that shows anything similar to
what I am trying to do.
Thanks for any help!
Mike
project. I think I might be trying to work farther ahead then I should. But
here is the situation.
I am writing a program to calc the size of a pizza along with toppings to go
on it. I have a combo box with 3 sizes and the price and 2 list boxes, one
with toppings that as you double-click on the item it moves it over to the
second list box.
For example "Medium $8.99"
And then a list box with 5 toppings that are sold for .99 cents each.
I have figured out how to initialize my combo box and list box as follows:
'Initialize combo box
cboSize.Text = "Pizza Size"
cboSize.Items.Add("Medium $8.99")
cboSize.Items.Add("Large $11.99")
cboSize.Items.Add("Gigantic $13.99")
'Initialize list box
lstChoices.Items.Add("Pepperoni")
lstChoices.Items.Add("Sausage")
lstChoices.Items.Add("Ham")
lstChoices.Items.Add("Onions")
lstChoices.Items.Add("Green Peppers")
lstChoices.Items.Add("Black Olives")
My problem is how do you take the item from the combobox turn it into and
integer? For example cboSize.Items.Add("Medium $8.99") = 8.99 Then take and
count the number of toppings from the listbox add them all together and
multiply it by .99 cents?
Not trying to cheat, just need a little help. I can't find anything in the
book up to the chapter we have covered so far that shows anything similar to
what I am trying to do.
Thanks for any help!
Mike