Click to See Complete Forum and Search --> : VB 6.0 Calculator
ronnel
03-09-2005, 11:20 PM
hello guys, I need your help for now...
We are asked to make a calculator.. a basic calculator..
and i dont know how to code that e!!! pls.. help me.. this is the screencap
http://img.photobucket.com/albums/v304/ronnel1/calc.jpg
hope u can help me as soon as possible
we are going to pass this tomorrow e!!
ray326
03-10-2005, 12:07 AM
And if you don't do it yourself you'll NEVER know how.
buntine
03-10-2005, 12:08 AM
You should be able to find an array of suitable solutions at Planet Source Code. A calculator is quite easy in VB6, its just basic arithmatic.
http://planet-source-code.com/ (Search for 'calculator' under 'Visual Basic') I think I even submitted a calcularot application a few years ago. Not sure if its still there.
Regards.
ronnel
03-10-2005, 12:13 AM
no, i know how to do it...
but this is ASAP e!!!
i know the codes but i forgot..
i think it goes something l;ike
Text1.Text = "Text2.Text" + "Text1.Text"
something...
Yeah that's it.
Just go though each command button and do that, e.g.
cmdAdd_Click()
txtAnswer = txtFirstNumber + txtSecondNumber
cmdDivide_Click()
txtAnswer = txtFirstNumber / txtSecondNumber
cmdSubtract_Click()
txtAnswer = txtFirstNumber - txtSecondNumber
and so on.
buntine
03-10-2005, 03:53 AM
Its probably best to cast each to integers before you perform calculations, though.
CInt(textValue)
ronnel
03-10-2005, 01:34 PM
hmm, guys,, i got it|!!! the code goes
Text3.Text = val(text1.Text) + val(text2.Text)
and so on...
but, do u know what is the code for the square rootand cube root?thankss,,,