title: Visual Basic Button with a Value
body: <p>Im new to this etc, and I was woundering if you can make a button equal a value once clicked. Heres what Iv'e got for an exmple:</p>
  
  <p>Public Class Form1</p>
  
  <pre><code>    Private Sub BuyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuyButton.Click
  
          Dim MoneyBtn1 As String
          Btn10p.PerformClick = MoneyBtn1
          MoneyBtn1 = 0.1 + AmountTextBox.Text
  
          Dim Cost, Amount, Change As Decimal
          Dim Pennies, Pounds As Integer
          Dim msg As String
  
          Cost = Decimal.Parse(CostTextBox.Text)
          Amount = Decimal.Parse(AmountTextBox.Text)
          Change = (Amount - Cost)
  
          If Change &lt; 0 Then
  
              msg = "You don't have enough Money"
  
          Else
  
              Pounds = Math.Floor(Change)
              Pennies = (Change - Pounds) * 100
  
              msg = "Your change is: " &amp; Change.ToString("##.00") &amp; Environment.NewLine
              msg += "Pounds: " &amp; Pounds &amp; vbNewLine
              msg += "Pennies: " &amp; Pennies &amp; vbNewLine
  
          End If
          ChangeLabel.Text = msg
      End Sub
  End Class
  </code></pre>
  
  <p>Answer I have used:
    Private Sub Btn10p_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn10p.Click
          AmountTextBox.Text = AmountTextBox.Text + 0.1
      End Sub</p>