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:
Public Class Form1
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 < 0 Then
msg = "You don't have enough Money"
Else
Pounds = Math.Floor(Change)
Pennies = (Change - Pounds) * 100
msg = "Your change is: " & Change.ToString("##.00") & Environment.NewLine
msg += "Pounds: " & Pounds & vbNewLine
msg += "Pennies: " & Pennies & vbNewLine
End If
ChangeLabel.Text = msg
End Sub
End Class
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
Do you mean the text on a button? Or do you simply want more than one click event to perform the same increment routine? If the latter then
If that's not what you're after then you need to explain exactly what you want in better detail.