|
-
Feb 26th, 2008, 11:22 PM
#1
Thread Starter
Junior Member
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"???
-
Feb 26th, 2008, 11:50 PM
#2
Frenzied Member
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
-
Feb 26th, 2008, 11:56 PM
#3
Thread Starter
Junior Member
Re: Coding Problem
I did that, but it says intTwenty is an unused variable???
-
Feb 27th, 2008, 12:05 AM
#4
Frenzied Member
Re: Coding Problem
Well you haven't used intTwenty anywhere.
-
Feb 27th, 2008, 12:08 AM
#5
Thread Starter
Junior Member
Re: Coding Problem
I put it as the name of the label $20, as in intTwenty?
Where would I use intTwenty on the interface?????
-
Feb 27th, 2008, 12:10 AM
#6
Frenzied Member
Re: Coding Problem
I've responded to your PM.
-
Feb 27th, 2008, 09:13 AM
#7
Re: Coding Problem
Please do not create duplicate threads - this thread is now closed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|