Liked us?

Everything to Improve Your knowledge Create simple calculator VB 6.0 | <a href="/">Detailed expert reviews</a>

Monday, December 12, 2011

Create simple calculator VB 6.0

,


Create simple calculator using VB 6.0
Open new project.
Add 16 Command Button & text box.
Change the command button caption 0 , 1 , 2 , 3 , 4 ,5 , 6 , 7 , 8 , 9 , . , + , -  , * , / and =
Create 0-9 command button control array.
Like cmbNo(0) , cmdNo(1) , cmdNo(2), …., cmdNo(9)  Like this..
Change text box name txtno
Change other command button sutable name.

======================
Coding
Dim no1 As Double
Dim no2 As Double
Dim symbol As String
______________________
Private Sub cmdAdd_Click()
no1 = Val(txtNo.Text)
symbol = "+"
txtNo.Text = ""
End Sub
_______________________
Private Sub cmddevide_Click()
no1 = Val(txtNo.Text)
symbol = "/"
txtNo.Text = ""
End Sub
________________________
Private Sub cmddot_Click()
    txtNo.Text = txtNo.Text & "."
End Sub
________________________
Private Sub cmdEqul_Click()
no2 = Val(txtNo.Text)
If symbol = "+" Then
    txtNo.Text = Format(Val(no1 + no2), "0.00")
ElseIf symbol = "-" Then
    txtNo.Text = Format(Val(no1 - no2), "0.00")
ElseIf symbol = "*" Then
    txtNo.Text = Format(Val(no1 * no2), "0.00")
ElseIf symbol = "/" Then
    txtNo.Text = Format(Val(no1 / no2), "0.00")
End If
End Sub
________________________
Private Sub cmdminus_Click()
no1 = Val(txtNo.Text)
symbol = "-"
txtNo.Text = ""
End Sub
________________________
Private Sub cmdmul_Click()
no1 = Val(txtNo.Text)
symbol = "*"
txtNo.Text = ""
End Sub
__________________________
Private Sub cmdNO_Click(Index As Integer)
    txtNo.Text = txtNo.Text & Index
End Sub
======================

If you have any doubt please comment it. I will help you.


Download sample project (3 MB)


http://www.fileserve.com/file/eBBTaZn/Calculater.rar

19 comments to “Create simple calculator VB 6.0”

  • December 12, 2011 at 7:07 AM
    Anonymous says:

    code eke podi error ekak tiyenawa! hadala denna puluwanda?

  • December 12, 2011 at 7:09 AM
    e-tutes says:

    Mokakkda error eaka.. kiyanna..

  • December 12, 2011 at 5:43 PM

    i can creat a cal using python. Awesome e- tutez. Nice share, and very informative.

  • December 12, 2011 at 6:49 PM
    e-tutez says:

    Thanks buddy... :) :)

  • January 10, 2013 at 6:19 PM
    Anonymous says:

    error

  • January 11, 2013 at 2:06 AM
    etutez says:

    Check again. it s working fine.

  • March 3, 2013 at 4:26 AM
    Anonymous says:

    it working thanks

  • March 4, 2013 at 8:20 PM
    etutez says:

    Welcome..!!

  • April 12, 2013 at 4:30 AM
    Anonymous says:

    please send me the code that can add more than two numbers in your calculator

  • April 17, 2013 at 3:05 AM
    etutez says:

    give your e-mail address

  • May 29, 2013 at 9:47 PM
    Anonymous says:

    please send me source soklin102@gmail.com

  • June 5, 2013 at 6:40 AM
    Anonymous says:

    Please i need a code for the 'MC, MR,M-,M+'. Pls kindly help me out

  • July 12, 2013 at 10:33 PM
    Anonymous says:

    not error but output is wrong please help me

  • July 15, 2013 at 3:15 AM
    etutez says:

    Give your mail plz

  • September 16, 2013 at 10:40 PM
    Anonymous says:

    itz working....thanx

  • October 16, 2013 at 2:41 PM
    Anonymous says:

    please send me the code that can add more than two numbers in your calculator

  • October 16, 2013 at 2:43 PM
    Anonymous says:

    My Gmail Id : msqjobs@gmail.com Please Share "please send me the code that can add more than two numbers in your calculator". Please response at the earliest & oblige

  • November 20, 2014 at 1:38 AM
    etutez says:

    Ok . i will send you to source code.

  • September 26, 2016 at 9:31 PM
    Blogger says:

    Are you monetizing your exclusive shared links?
    Did you know that Mgcash will pay you an average of $500 per 1,000 unlocks?

Post a Comment

 

Liked

Detailed expert reviews Copyright © 2011 | Template design by O Pregador | Powered by Blogger Templates