-
Coding Problem
I am making a code to calculate the total change from cash entered when I click the calculate button, I also need the number of 20s and 10 and 5s given back put in the label next to the corresponding number.
My code looks like
Private Sub btnCalculate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCalculate.Click
'declare local variables
Dim lblTwenty As Integer
End Sub
But it says intTwenty is an undeclared local variable when I named the label box next to 20 "lblTwenty"???
-
Re: Coding Problem
This is VB.NET, next time post here: http://www.vbforums.com/forumdisplay.php?f=25
Also:
Private Sub btnCalculate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCalculate.Click
'declare local variables
Dim lblTwenty As Integer
You are dimming lblTwenty as an integer.
Should be:
Dim intTwenty As Integer
-
Re: Coding Problem
I did that, but it says intTwenty is an unused variable???
-
Re: Coding Problem
Well you haven't used intTwenty anywhere.
-
Re: Coding Problem
I put it as the name of the label $20, as in intTwenty?
Where would I use intTwenty on the interface?????
-
Re: Coding Problem
I've responded to your PM.
-
Re: Coding Problem
Please do not create duplicate threads - this thread is now closed.