-1

I'm making a program for the cinema in which you select a movie, number of people (adults, children, teens, seniors) and whether or not you have a loyalty card. The aim is the program takes the number of people and the movie into account, calculates a price and also how many points you will have earned in that sale. Only problem is, i'm using ComboBoxes in the form and I don't know how to utilize them. If I were using Radio Buttons I would do something like this:

If [Radio button var].Checked Then

Whereas I don't know how to declare and use ComboBoxes. I know all options in ComboBoxes are stored as arrays, i.e. Option 1, 2, and 3 is [0, 1, 2] but I don't know how to utilize this in VB. Is it something like:

If [ComboBoxName].[Option].Selected Then

I have no idea.

1 Answers1

0

As I far as understand you are trying to do something along the lines of:

If ComboBox1.SelectedItem = "" Then

End If
  • Yes, that's it. How do I convert the selections into usable variables? What i'm trying to do is to multiply the quantity of, say, adults by the ticket price. Is there a way I can also use <,> or = when referring to selected items? i.e. `code` If childBox.SelectedItem >= "0" And childBox.SelectedItem <= "5" Then – Aprils_Renegade Oct 10 '15 at 15:59
  • You could try something along the lines of: numberOfChildTickets = Cint(childBox.selectedItem) if numberOfChildTickets > = 0 and numberOfChildTickets < = 5 Then code here. –  Oct 10 '15 at 23:08