I already made the calculator, but I'm trying to also put the function used in the textbox results. Example:

2 * 2 = The function used was multiplication. Your answer is 4

I used labels to identify -, +, *, /
Two textboxes to put in input.
1 textbox for ouput.

I used this sample code for my calculator :

lblnum1 = "+"
lblnum1 = val(txta.text) + val(txtb.text)


the output i want is:
2 * 2 = The function used was multiplication. Your answer is 4

Here's a program to look at. My apologies for not using text boxes. I used buttons and then realized my mistake after re-reading your post. Still, the same theory applies... Store the values, and then include those values in your answer.

Ohhh nice one :D. Thanks, but i used visual basic 2005 express and i cant open the .vb files or which ever ones for the code ? how can i view the code ?

In whatever code you develop to solve this problem, consider what you would do if the user types in a formula that contains multiple functions (e.g. 3 + 4 - 2).

Hoppy

Glad you liked it. Here's the code. You may need to do some changes to it, because of the software you're using. Try the vb.net forum if you get stuck. Good luck :)

Thanks Prozeen. I got it working :D. Code helped a lot thanks :D.

Glad to hear you got it working. Thanks for the reply. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.