Webnode

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: 08/02/2014

By: Chelmiz

Subject: VB calculator

cc à tous!! Je suis préocupé par la création d'une calculatrice. Aidez moi si vs pouvez

Reply

—————

Date: 17/10/2013

By: mohilan

Subject: comment

Thanks

Reply

—————

Date: 25/08/2013

By: rohit

Subject: asdf

can anyone make calculater having back button ,that remove the content of textbox one by one as others calculator

Reply

—————

Date: 27/05/2013

By: ya

Subject: how

How do i get it to run without v.b opening

Reply

—————

Date: 06/03/2013

By: soshi

Subject: programing

simple .. can you create more than that ?

Reply

—————

Date: 06/03/2013

By: soshi

Subject: programing

simple .. can you create more than that ?

Reply

—————

Date: 27/02/2013

By: Aaron kid

Subject: you all idiots

your all cocksucker hahahahahahahahahahahahahhahaahahaha jews

Reply

—————

Date: 09/02/2013

By: patrick

Subject: suck

fuck mother fucker!!! cock sucker!!

Reply

—————

Date: 08/02/2013

By: misg

Subject: programing

pls send me calculator code in visual studio

Reply

—————

Date: 10/12/2012

By: kiran bala

Subject: calculate

how to create a calculator in vb.net

Reply

—————