Hi am quite new to visual studios.
This is my code so far to make an example of an atm, i have a text box and i put an amount in and then i have this button where i clic
String in textboxamount.Text
can not be parsed as double. To avoid exception you can use double.TryParse
instead.
double amount;
if(double.TryParse(textboxamount.Text, out amount))
{
totalamount += amount;
}
Also, label2
seems to be Label
and you must use
label2.Text = balance1 + totalamount;
instead.