Option Explicit On 
Option Strict On

Public Class frmPizza
  Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

  Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

  End Sub

  'Form overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
      If Not (components Is Nothing) Then
        components.Dispose()
      End If
    End If
    MyBase.Dispose(disposing)
  End Sub
  Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
  Friend WithEvents btnBuild As System.Windows.Forms.Button
  Friend WithEvents btnExit As System.Windows.Forms.Button
  Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
  Friend WithEvents chkCheese As System.Windows.Forms.CheckBox
  Friend WithEvents chkMushrooms As System.Windows.Forms.CheckBox
  Friend WithEvents chkOlives As System.Windows.Forms.CheckBox
  Friend WithEvents chkTomatoes As System.Windows.Forms.CheckBox
  Friend WithEvents chkOnions As System.Windows.Forms.CheckBox
  Friend WithEvents chkPeppers As System.Windows.Forms.CheckBox
  Friend WithEvents rdoSmall As System.Windows.Forms.RadioButton
  Friend WithEvents rdoMedium As System.Windows.Forms.RadioButton
  Friend WithEvents rdoLarge As System.Windows.Forms.RadioButton
  Friend WithEvents rdoOut As System.Windows.Forms.RadioButton
  Friend WithEvents rdoThin As System.Windows.Forms.RadioButton
  Friend WithEvents rdoThick As System.Windows.Forms.RadioButton
  Friend WithEvents rdoIn As System.Windows.Forms.RadioButton

  'Required by the Windows Form Designer
  Private components As System.ComponentModel.Container

  'NOTE: The following procedure is required by the Windows Form Designer
  'It can be modified using the Windows Form Designer.  
  'Do not modify it using the code editor.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.GroupBox2 = New System.Windows.Forms.GroupBox()
    Me.rdoThin = New System.Windows.Forms.RadioButton()
    Me.rdoThick = New System.Windows.Forms.RadioButton()
    Me.btnBuild = New System.Windows.Forms.Button()
    Me.chkOlives = New System.Windows.Forms.CheckBox()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.chkMushrooms = New System.Windows.Forms.CheckBox()
    Me.rdoOut = New System.Windows.Forms.RadioButton()
    Me.rdoIn = New System.Windows.Forms.RadioButton()
    Me.rdoMedium = New System.Windows.Forms.RadioButton()
    Me.chkOnions = New System.Windows.Forms.CheckBox()
    Me.GroupBox1 = New System.Windows.Forms.GroupBox()
    Me.rdoSmall = New System.Windows.Forms.RadioButton()
    Me.rdoLarge = New System.Windows.Forms.RadioButton()
    Me.GroupBox3 = New System.Windows.Forms.GroupBox()
    Me.chkTomatoes = New System.Windows.Forms.CheckBox()
    Me.chkPeppers = New System.Windows.Forms.CheckBox()
    Me.chkCheese = New System.Windows.Forms.CheckBox()
    Me.GroupBox2.SuspendLayout()
    Me.GroupBox1.SuspendLayout()
    Me.GroupBox3.SuspendLayout()
    Me.SuspendLayout()
    '
    'GroupBox2
    '
    Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdoThin, Me.rdoThick})
    Me.GroupBox2.Location = New System.Drawing.Point(16, 128)
    Me.GroupBox2.Name = "GroupBox2"
    Me.GroupBox2.Size = New System.Drawing.Size(128, 88)
    Me.GroupBox2.TabIndex = 0
    Me.GroupBox2.TabStop = False
    Me.GroupBox2.Text = "Crust Type"
    '
    'rdoThin
    '
    Me.rdoThin.Checked = True
    Me.rdoThin.Location = New System.Drawing.Point(16, 24)
    Me.rdoThin.Name = "rdoThin"
    Me.rdoThin.TabIndex = 0
    Me.rdoThin.TabStop = True
    Me.rdoThin.Text = "Thin Crust"
    '
    'rdoThick
    '
    Me.rdoThick.Location = New System.Drawing.Point(16, 48)
    Me.rdoThick.Name = "rdoThick"
    Me.rdoThick.TabIndex = 0
    Me.rdoThick.Text = "Thick Crust"
    '
    'btnBuild
    '
    Me.btnBuild.Location = New System.Drawing.Point(80, 224)
    Me.btnBuild.Name = "btnBuild"
    Me.btnBuild.Size = New System.Drawing.Size(120, 23)
    Me.btnBuild.TabIndex = 3
    Me.btnBuild.Text = "&Build Pizza"
    '
    'chkOlives
    '
    Me.chkOlives.Location = New System.Drawing.Point(16, 88)
    Me.chkOlives.Name = "chkOlives"
    Me.chkOlives.TabIndex = 6
    Me.chkOlives.Text = "Black Olives"
    '
    'btnExit
    '
    Me.btnExit.Location = New System.Drawing.Point(248, 224)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(120, 23)
    Me.btnExit.TabIndex = 4
    Me.btnExit.Text = "E&xit"
    '
    'chkMushrooms
    '
    Me.chkMushrooms.Location = New System.Drawing.Point(16, 56)
    Me.chkMushrooms.Name = "chkMushrooms"
    Me.chkMushrooms.TabIndex = 6
    Me.chkMushrooms.Text = "Mushrooms"
    '
    'rdoOut
    '
    Me.rdoOut.Location = New System.Drawing.Point(304, 168)
    Me.rdoOut.Name = "rdoOut"
    Me.rdoOut.TabIndex = 2
    Me.rdoOut.Text = "Take Out"
    '
    'rdoIn
    '
    Me.rdoIn.Checked = True
    Me.rdoIn.Location = New System.Drawing.Point(192, 168)
    Me.rdoIn.Name = "rdoIn"
    Me.rdoIn.TabIndex = 1
    Me.rdoIn.TabStop = True
    Me.rdoIn.Text = "Eat In"
    '
    'rdoMedium
    '
    Me.rdoMedium.Location = New System.Drawing.Point(16, 48)
    Me.rdoMedium.Name = "rdoMedium"
    Me.rdoMedium.TabIndex = 0
    Me.rdoMedium.Text = "Medium"
    '
    'chkOnions
    '
    Me.chkOnions.Location = New System.Drawing.Point(128, 24)
    Me.chkOnions.Name = "chkOnions"
    Me.chkOnions.TabIndex = 6
    Me.chkOnions.Text = "Onions"
    '
    'GroupBox1
    '
    Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdoSmall, Me.rdoMedium, Me.rdoLarge})
    Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.GroupBox1.Location = New System.Drawing.Point(16, 8)
    Me.GroupBox1.Name = "GroupBox1"
    Me.GroupBox1.Size = New System.Drawing.Size(128, 112)
    Me.GroupBox1.TabIndex = 0
    Me.GroupBox1.TabStop = False
    Me.GroupBox1.Text = "Size"
    '
    'rdoSmall
    '
    Me.rdoSmall.Checked = True
    Me.rdoSmall.Location = New System.Drawing.Point(16, 24)
    Me.rdoSmall.Name = "rdoSmall"
    Me.rdoSmall.TabIndex = 0
    Me.rdoSmall.TabStop = True
    Me.rdoSmall.Text = "Small"
    '
    'rdoLarge
    '
    Me.rdoLarge.Location = New System.Drawing.Point(16, 72)
    Me.rdoLarge.Name = "rdoLarge"
    Me.rdoLarge.TabIndex = 0
    Me.rdoLarge.Text = "Large"
    '
    'GroupBox3
    '
    Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.chkTomatoes, Me.chkOnions, Me.chkPeppers, Me.chkOlives, Me.chkMushrooms, Me.chkCheese})
    Me.GroupBox3.Location = New System.Drawing.Point(168, 16)
    Me.GroupBox3.Name = "GroupBox3"
    Me.GroupBox3.Size = New System.Drawing.Size(248, 136)
    Me.GroupBox3.TabIndex = 5
    Me.GroupBox3.TabStop = False
    Me.GroupBox3.Text = "Toppings"
    '
    'chkTomatoes
    '
    Me.chkTomatoes.Location = New System.Drawing.Point(128, 88)
    Me.chkTomatoes.Name = "chkTomatoes"
    Me.chkTomatoes.TabIndex = 6
    Me.chkTomatoes.Text = "Tomatoes"
    '
    'chkPeppers
    '
    Me.chkPeppers.Location = New System.Drawing.Point(128, 56)
    Me.chkPeppers.Name = "chkPeppers"
    Me.chkPeppers.TabIndex = 6
    Me.chkPeppers.Text = "Green Peppers"
    '
    'chkCheese
    '
    Me.chkCheese.Location = New System.Drawing.Point(16, 24)
    Me.chkCheese.Name = "chkCheese"
    Me.chkCheese.TabIndex = 6
    Me.chkCheese.Text = "Extra Cheese"
    '
    'frmPizza
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(450, 271)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupBox3, Me.btnExit, Me.btnBuild, Me.rdoOut, Me.GroupBox2, Me.GroupBox1, Me.rdoIn})
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
    Me.Name = "frmPizza"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "Pizza Order"
    Me.GroupBox2.ResumeLayout(False)
    Me.GroupBox1.ResumeLayout(False)
    Me.GroupBox3.ResumeLayout(False)
    Me.ResumeLayout(False)

  End Sub

#End Region

  Dim PizzaSize As String
  Dim PizzaCrust As String
  Dim PizzaWhere As String
  Dim Topping(6) As CheckBox

  Private Sub frmPizza_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Initialize parameters
    PizzaSize = rdoSmall.Text
    PizzaCrust = rdoThin.Text
    PizzaWhere = rdoIn.Text
    'Define an array of topping check boxes 
    Topping(1) = chkCheese
    Topping(2) = chkMushrooms
    Topping(3) = chkOlives
    Topping(4) = chkOnions
    Topping(5) = chkPeppers
    Topping(6) = chkTomatoes
  End Sub

  Private Sub rdoSize_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoSmall.CheckedChanged, rdoMedium.CheckedChanged, rdoLarge.CheckedChanged
    Dim rdoSize As RadioButton
    'Determine which button was clicked and change size
    rdoSize = CType(sender, RadioButton)
    PizzaSize = rdoSize.Text
  End Sub

  Private Sub rdoCrust_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoThin.CheckedChanged, rdoThick.CheckedChanged
    Dim rdoCrust As RadioButton
    'Determine which button was clicked and change crust
    rdoCrust = CType(sender, RadioButton)
    PizzaCrust = rdoCrust.Text
  End Sub

  Private Sub rdoWhere_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoIn.CheckedChanged, rdoOut.CheckedChanged
    Dim rdoWhere As RadioButton
    'Determine which button was clicked and change where
    rdoWhere = CType(sender, RadioButton)
    PizzaWhere = rdoWhere.Text
  End Sub

  Private Sub btnBuild_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuild.Click
    'This procedure builds a message box that displays your pizza type
    Dim Message As String
    Dim I As Integer
    Message = PizzaWhere + ControlChars.Cr
    Message += PizzaSize + " Pizza" + ControlChars.Cr
    Message += PizzaCrust + ControlChars.Cr
    'Check each topping using the array we set up
    For I = 1 To 6
      If Topping(I).Checked Then
        Message += Topping(I).Text + ControlChars.Cr
      End If
    Next I
    MessageBox.Show(Message, "Your Pizza", MessageBoxButtons.OK)
  End Sub


  Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
    Me.Close()
  End Sub


End Class
