Simple Calculator in Visual Basic 6

Discussion in 'Visual Basic [VB]' started by shabbir, Aug 26, 2010.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    A Simple Windows Like Calculator in Visual Basic 6. See the Screenshot.

    [​IMG]

    Keyboard Shortcuts

    Ascii code of '0' is '48' and is a short cut key to '0'
    Ascii code of '1' is '49' and is a short cut key to '1'
    Ascii code of '2' is '50' and is a short cut key to '2'
    Ascii code of '3' is '51' and is a short cut key to '3'
    Ascii code of '4' is '52' and is a short cut key to '4'
    Ascii code of '5' is '53' and is a short cut key to '5'
    Ascii code of '6' is '54' and is a short cut key to '6'
    Ascii code of '7' is '55' and is a short cut key to '7'
    Ascii code of '8' is '56' and is a short cut key to '8'
    Ascii code of '9' is '57' and is a short cut key to '9'
    Ascii code of 'Ctrl+O' is '15' and is a short cut key to '00'
    Ascii code of '.' is and 46 is a short cut key to'.'
    Ascii code of '+' is and 43 is a short cut key to'+'
    Ascii code of '-' is and 45 is a short cut key to '-'
    Ascii code of '*' is and 42 is a short cut key to '*'
    Ascii code of '/' is and 47 is a short cut key to '/'
    Ascii code of 'Ctrl+M' is 13 and is a short cut key to 'M+'
    Ascii code of 'Ctrl+P' is 16 and is a short cut key to 'M-'
    Ascii code of 'Ctrl+R' is 18 and is a short cut key to 'MR'
    Ascii code of 'Ctrl+C' is 3 and is a short cut key to 'MC'
    Ascii code of 'Esc' is 27 and is a short cut key to 'CE'
    Ascii code of 'Backspace'is 8 and is a short cut key to 'C'
    Ascii code of 'Ctrl+s' is 19 and is a short cut key to '+/-'
    Ascii code of 'Enter' is "Not Required" and is a short cut key to '='

    NOTE: The control array code is of my school days and is not very efficiently done but I guess the functionality of the program is quite good one.
     

    Attached Files:

    Last edited: Jan 21, 2017
    andrew3541 and vikas rudani like this.
  2. MartinJose

    MartinJose New Member

    Joined:
    Aug 17, 2010
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Home Page:
    http://www.comm100.com/emailmarketingnewsletter/
    I remember I used to make a calculator like this when I was having a VB class.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Same here. This code is of my school days,
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    It is not possible and you will need to use scripting languages like JavaScript
     
  5. helloword

    helloword New Member

    Joined:
    Aug 30, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    china
    oh ,this is i can
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
  7. sheppardalbert

    sheppardalbert New Member

    Joined:
    Aug 30, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student MBA and Premed
    Location:
    SF Bay Area California
    Something wrong with that calculator attachment... my WinZip (current copy) says it does not appear to be a valid archive... try downloading it again... I DID... 3 times and it failed to open.
     
  8. sheppardalbert

    sheppardalbert New Member

    Joined:
    Aug 30, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student MBA and Premed
    Location:
    SF Bay Area California
    Does anyone have the code for a VB.Net 8 calculator... would there be much difference. Can you send the code? The zip file with this code on this page won't open.
    Albert
     
  9. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re-downloaded it once again and it works fine for me. I also tested from a second PC and it works as expected.
     
  10. sheppardalbert

    sheppardalbert New Member

    Joined:
    Aug 30, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student MBA and Premed
    Location:
    SF Bay Area California
    No... It still does NOT open... "Cannot open file: It does not appear to be a valid archive. If you downloaded this file, try downloading it again.

    I tried it before multiple times and again today multiple times; and I tried it on both my desktope and my laptop... the zip does NOT open...

    I have the latests version of WinZip Pro and Windows 7 Ultimate... and I don't have problems zipping and opening files except with this one.
     
  11. sheppardalbert

    sheppardalbert New Member

    Joined:
    Aug 30, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student MBA and Premed
    Location:
    SF Bay Area California
    Can you send me the code to my email address? For the VB.Net calculator...
    Albert
     
  12. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I have uploaded one more file and this time the file does not contain the exe file but is same as the other one and let me know if this works. If not PM me your email address and I will try sending you in your email.
     
  13. ratnesh

    ratnesh New Member

    Joined:
    Oct 3, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    lucknow (up)
    good program ..
     
  14. seoguru

    seoguru New Member

    Joined:
    Oct 6, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    http://www.seofleet.com
    thsi is a good information of Calculator

    thanks for telling with us
     
  15. Abdullahi Mohammed

    Abdullahi Mohammed New Member

    Joined:
    Aug 20, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Computer Technician
    Location:
    Adamawa, Nigeria
    Designing a web browser with VB2008

    How can i create a web browser using Visual Studio 2008
     
  16. mukeshsoftona

    mukeshsoftona Banned

    Joined:
    Oct 28, 2011
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    0
    Hi dear.
    I done B.sc IT and i used this code for my smaller project report. When i saw this post i really love it. this code is free from errors because it read it.
     
  17. edwardallene

    edwardallene New Member

    Joined:
    Apr 16, 2012
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    Home Page:
    http://shop.pchappy.com.au/
    I also remember this interface when I was in college and our professor told us to make a calculator and when we did it, it ran and it was actually our first program ran in Visual Basic.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice