Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   16 Buttons for calculator with coding (https://www.askmehelpdesk.com/showthread.php?t=369748)

  • Jun 27, 2009, 07:49 PM
    gian carlo
    16 Buttons for calculator with coding
    I need a help because I have an project with visual basic

    Calculator with 16 buttons but I don't know what to do with this one project?

    So please help me?

    Thank you very much!

    :confused:
  • Jun 27, 2009, 08:03 PM
    Perito

    Drop 16 buttons on a calculator and label those buttons. If you're using Visual Basic (as opposed to Visual Basic.NET), you can create a "control array" and one event handler can handle all of the events. You can use the caption property to figure out what to do.

    When one of the keys is pressed, you have to add a numeral to an "accumulator". This can be a text box on the form. So, if I press <1><2><3>, you'll want "123" to appear in the text box. This is simple stuff.

    Finally, when a function key, "+", "-", "*", "/", you have to process it. Basically, you'll store the value in the accumulator text box into a hidden variable. You'll save the operation (the function key) so you'll know what to do when +, -, *, or / is hit again or when "=" is hit. You'll then allow the user to hit numeral keys to put a value into the "accumulator".

    Start by putting the 16 buttons on the form and labeling them. Tell me what the labels are. Put a text box for a visible accumulator and create a variable for a hidden accumulator. Create an event handler for clicking the number keys. Make it so that when a number key is clicked, a numeral is added to the text box. When you get that done, put the source code in a ZIP file and attach it to a post here. (click the <Go Advanced> button. I'll coach you on handling the +, -, *, /, and = buttons.
  • Jul 12, 2009, 11:51 AM
    bhawna sohni
    I'm making project on making calculator in visual basic 6.0 version. Can you please help me out for this. I'm in hurry, please help me and answer my query as soon as possible. Thank you.
  • Jul 13, 2009, 10:08 AM
    Perito

    Quote:

    I'm making project on making calculator in visual basic 6.0 version. Can you please help me out for this. I'm in hurry, please help me and answer my query as soon as possible. Thank you.
    You should post your question in a new thread or no one will see it.

    I'll give you the same answer that I gave to "gian carlo". It's in the box above your post. Show me what you did (you can put all of the program files in a zip file, click "Go Advanced", and attach it to your message) and I'll be happy to help you out with what you're stumped on. But, no one here will do your homework for you.
  • May 1, 2012, 05:31 AM
    kersie
    Please I make a scientific calculator but I can't explain it?please help me

  • All times are GMT -7. The time now is 06:13 AM.