Code for scientific calculator in visual basic?

1 answer

Answer

1253138

2026-04-17 09:15

+ Follow

Prep work: add 3 textboxes and 4 buttons

Button1 = Add

Button2 = Subtract

Button3 = Multiply

Button4 = Divide

Make sure to keep a textbox for the answer (I'll use one called, "TextBox3")

For Button 1:

TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.text)

'This takes text1's value and adds text2's value to it

For Button 2:

TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)

'same as button one but subtract

For Button 3:

TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)

For Button 4:

TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.