VB Calculator

Hello, in this tutorial I'll teach you how to make a small calculator that will look like this:

(Example)

 

1. Open Visual studio 2010
2. Create a new visual basic windows form application project (.Netframework 3.5 or higher)
3. Call your project Calculator
4. Add 4 buttons, 3 textboxes (and maybe some labels), as you can see in the example picture above.
5. Change the text of your buttons to "+" , "-", "*", "/
6. Set the result-textbox propertie readonly to True:

This will make sure that the user cannot edit the result.

9. Double click the "+" button and add the following codes:

TextBox3.Text = (Integer.Parse(TextBox1.Text) + Integer.Parse(TextBox2.Text)).ToString()
 

10. Double click the '-' button and add the following codes:

TextBox3.Text = (Integer.Parse(TextBox1.Text) - Integer.Parse(TextBox2.Text)).ToString()

11. Double click the '*' button and add the following codes:

TextBox3.Text = (Integer.Parse(TextBox1.Text) * Integer.Parse(TextBox2.Text)).ToString()

12. Double click the '/' button and add the following codes:

TextBox3.Text = (Integer.Parse(TextBox1.Text) / Integer.Parse(TextBox2.Text)).ToString()

And now you made your very own calculator !

Download the source codes:

Calculator.rar (63,9 kB)


Topic: VB2010 Calculator

Date: 07/11/2012

By: GANESH

Subject: Working Good

Thank you it is working good

Reply

—————

Date: 09/12/2012

By: SAI SUHAN

Subject: Re: Working Good

THE WAY YOU DID THE SIMPLE CALCULATOR IS JUST AS SIMPLE AS A PIECE OF CAKE!
Thank you anyway

Reply

—————

Date: 04/11/2012

By: Tyler

Subject: Caculator

What kind of bullshit is this? I've seen better calculators from a 5 yo.

Reply

—————

Date: 10/10/2012

By: zanal

Subject: calculator code

this shit sucks suck my cock u slut ahahahahah

Reply

—————

Date: 29/10/2012

By: None

Subject: Re: calculator code

Ahahahaha made my day

Reply

—————

Date: 10/08/2012

By: metal

Subject: calculator

what is the code in equals without using select case and else if?

Reply

—————