title: VB 2010 Radio Button Cost Calculation on a form
body: <p>I am running into an issue using VB 2010 - I am trying to calculate the cost of carpet based on the selection of 1 of 3 radio buttons. </p>
  
  <p>I have this at the top of my form:</p>
  
  <pre><code>Private CarpetPrice, UnderlayPrice As Decimal
  </code></pre>
  
  <p>here is my code for the button click</p>
  
  <pre><code>Private Sub CostButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CostButton.Click
      ' Calculate button click
      ' Radio Button IF Statement for calculating cost
      If EconomyRadioButton.Checked Then
          UnderlayPrice = 3.95 And CarpetPrice = 12.95
      ElseIf DeluxeRadioButton.Checked Then
          UnderlayPrice = 4.95 And CarpetPrice = 15.49
      ElseIf PlushRadioButton.Checked Then
          UnderlayPrice = 5.95 And CarpetPrice = 19.95
      End If
      ' Start Calculations
      CarpetNumLabel.Text = (((Length1TextBox.Text * Width1TextBox.Text) / 1296) + ((Length2TextBox.Text * Width2TextBox.Text) / 1296) + _
          ((Length3TextBox.Text * Width3TextBox.Text) / 1296) + ((HallLengthTextBox.Text * HallWidthTextBox.Text) / 1296)) * 1.05
      UnderlayNumLabel.Text = CarpetNumLabel.Text
      TackNumLabel.Text = ((Length1TextBox.Text / 96) + (Width1TextBox.Text / 96) + (Length2TextBox.Text / 96) + (Width2TextBox.Text / 96) _
          + (Length3TextBox.Text / 96) + (Width3TextBox.Text / 96) + (HallLengthTextBox.Text / 96) + (HallWidthTextBox.Text / 96)) * 1.1
      ScrewNumLabel.Text = ((TackNumLabel.Text / 1.1) * 8) / 50
      CarpetCostLabel.Text = CarpetNumLabel.Text * CarpetPrice
      UnderlayCostLabel.Text = UnderlayNumLabel.Text * UnderlayPrice
      TackCostLabel.Text = TackNumLabel.Text
      ScrewCostLabel.Text = ScrewNumLabel.Text * 2.85
  
  End Sub
  </code></pre>
  
  <p>Right now everything is running perfect except the carpet and underlay does not calculate the prices. Do I have to do something else to make the program recognize the status of the radio buttons when I click the button? -</p>
  
  <p>I think my problem is at the : </p>
  
  <pre><code>CarpetCostLabel.Text = CarpetNumLabel.Text * CarpetPrice
  UnderlayCostLabel.Text = UnderlayNumLabel.Text * UnderlayPrice
  </code></pre>
  
  <p>Thank you for any help.</p>