Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  Answer this Question    Ask about Visual Basic    Ask about another Subject  
 

sheenie
Oct 5, 2009, 09:52 PM
hello everyone,.
Please...
Who can help me making code in simple calculator?..
I really don't know how to make a code, i just design a simple calculator in Vb 6.0 it has a basic functions...
Thanks.

Perito
Oct 7, 2009, 02:36 PM
Here's an answer I gave some time ago for this same problem:

http://www.askmehelpdesk.com/visual-basic/16-buttons-calculator-coding-369748.html

Basically you drop 10 buttons on a form and label them 0 through 9. Drop 5 more buttons on the form and label them +, -, *, /, and =. Drop a textbox on a form for the result. Put two more buttons on the form and label them "C" and "CE" for clear and clear entry. You have to write code to handle the pushing of the buttons. You have to figure out the "state" of the calculator. There are at least these states:

1. The first number has not been entered or is being entered.
2. The first number has been entered and a function key has been pressed (not =)
3. A second number has been entered and another function key has been pressed (not =)
4. At least two numbers have been pressed and the = button has just been pressed.

Are you just supposed to design this without actually writing code?