Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

VS 2010 Decrease a variable

$
0
0
I have 2 textboxes: txtNumber and txtDigit

When I enter a number in txtNumber, an equation calculates a variable that I call intResult

For example, if I enter 100 in txtNumber, then intResult will equal to 7.

What I want is this:

Whenever I enter a different number in txtDigit, and click 'Calc' then intResult will decrease by 1.

For example:

Number = 100

intResult = 7

Number2 = 25 then, since number2 <> number, intResult-=1 (intResult = 6)

number2 = 63 then, since number2 <> number, intResult-=1 (intResult = 5)

and so on until intResult = 0

I worked different loops, but I haven't still figured it out.

Thank you.

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>