[Tut] Visual Basic 2005, Simple Program (Calculator)
Posted: Wed Apr 05, 2006 7:10 pm
Addition Calculator
1. Make a new project called whatever you want
2. Add in 3 textboxes and a button
3. Name the textboxes firstbox, secondbox, and final. Name the button ADDbtn
4. Double Click your button and add the code
what ^^^^^ this code means is that your stating the 3 textboxes are any Integer (whole number). Then that the first integer will be what is in the first textbox then the second integer what is in the second box. Finally result states that it is simply the first two integers added together and displayed in the Final TextBox
Try making other buttons that say other mathematical functions like subtract and divide using the same concept
1. Make a new project called whatever you want
2. Add in 3 textboxes and a button
3. Name the textboxes firstbox, secondbox, and final. Name the button ADDbtn
4. Double Click your button and add the code
Code: Select all
Dim firstnumber As Integer
Dim secondnumber As Integer
Dim result As Integer
firstnumber = Firstbox.Text
secondnumber=Secondbox.Text
result = firstnumber + secondnumber
Final.Text= result
Try making other buttons that say other mathematical functions like subtract and divide using the same concept