The problem I am haveing is that will accept alpha charicters on user input which creates an exception
error and crashes the program and I have no Idea how to fix this. my code for my change follows.
Any Assistance would be appreciater.
CODE
Public Class Form1
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim Leftover As Integer
Leftover = Integer.Parse(txtEnterPennies.Text)
txtDollars.Text = (Leftover \ 100).ToString
Leftover = Leftover Mod 100
txtQuarters.Text = (Leftover \ 25).ToString
Leftover = Leftover Mod 25
txtDimes.Text = (Leftover \ 10).ToString
Leftover = Leftover Mod 10
txtNickels.Text = (Leftover \ 5).ToString
Leftover = Leftover Mod 5
txtPennies.Text = Leftover.ToString
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtEnterPennies.Text = ""
txtDollars.Text = ""
txtQuarters.Text = ""
txtDimes.Text = ""
txtNickels.Text = ""
txtPennies.Text = ""
End Sub
End Class
Dick
This post has been edited by simsjunkie2003: 11 Dec, 2007 - 02:46 PM