Click here to Skip to main content
1,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey , thanks for clicking this , I was wondering how to "minus" a value in Visual Basic? I know you can do "+ 100" but I try "- 100" and it doesn't work , is there ANY way to minus a value in Visual Basic? :)
Posted

This is Not the right place to ask these questions, use Code Project.

But since I'm here.
If you are talking about 200 - 100 = 100 then

Dim Num1 as Integer = 200
Dim Num2 as Integer = 100

Dim Result as Integer

Result = Num1 - Num2

' output result to where ever you want.
'Such as 

TextBox1.Text = Result
 
Share this answer
 
v2
Comments
ledtech3 12-Sep-16 20:15pm    
@chris-maunder What was updated ?
Chris Maunder 13-Sep-16 15:50pm    
Just wrapped the code block in PRE tags to colourise it. (I'm sneakily using it to test some new content formatting code we have ;))
ledtech3 13-Sep-16 23:28pm    
Ok thanks it has been here for so long I forgot what it looked like.
Well you could simply multiply it by -1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



RootAdmin, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900