*/
Looking for work? Check out our jobs area.
*/

View Simple Calculator Which ask UID and PWd\frmCalculator.frm

Calculator 1.0

Submitted By: i_vergo
Rating: (Not rated) (Rate It)


VERSION 5.00
Begin VB.Form frmCalculator
   Caption         =   "Calculator"
   ClientHeight    =   3195
   ClientLeft      =   5745
   ClientTop       =   4785
   ClientWidth     =   3735
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   3735
   Begin VB.TextBox txtOp
      Alignment       =   2  'Center
      Enabled         =   0   'False
      Height          =   405
      Left            =   3120
      TabIndex        =   20
      Top             =   0
      Width           =   495
   End
   Begin VB.CommandButton cmdExit
      Caption         =   "&Exit"
      Height          =   495
      Left            =   2640
      TabIndex        =   19
      Top             =   480
      Width           =   855
   End
   Begin VB.CommandButton cmdPlus
      Caption         =   "+"
      Height          =   375
      Left            =   2760
      TabIndex        =   18
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdDivide
      Caption         =   "/"
      Height          =   375
      Left            =   2760
      TabIndex        =   17
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdMultiply
      Caption         =   "X"
      Height          =   375
      Left            =   2760
      TabIndex        =   16
      Top             =   1680
      Width           =   735
   End
   Begin VB.CommandButton cmdMinus
      Caption         =   "-"
      Height          =   375
      Left            =   2760
      TabIndex        =   15
      Top             =   2160
      Width           =   735
   End
   Begin VB.CommandButton cmdEqual
      Caption         =   "="
      Height          =   375
      Left            =   1920
      TabIndex        =   14
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdPoint
      Caption         =   "."
      Height          =   375
      Left            =   1080
      TabIndex        =   13
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdZero
      Caption         =   "0"
      Height          =   375
      Left            =   240
      TabIndex        =   12
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdNine
      Caption         =   "9"
      Height          =   375
      Left            =   1920
      TabIndex        =   11
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdEight
      Caption         =   "8"
      Height          =   375
      Left            =   1080
      TabIndex        =   10
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdSeven
      Caption         =   "7"
      Height          =   375
      Left            =   240
      TabIndex        =   9
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdSix
      Caption         =   "6"
      Height          =   375
      Left            =   1920
      TabIndex        =   8
      Top             =   1680
      Width           =   735
   End
   Begin VB.CommandButton cmdFive
      Caption         =   "5"
      Height          =   375
      Left            =   1080
      TabIndex        =   7
      Top             =   1680
      Width           =   735
   End
   Begin VB.CommandButton cmdFour
      Caption         =   "4"
      Height          =   375
      Left            =   240
      TabIndex        =   6
      Top             =   1680
      Width           =   735
   End
   Begin VB.CommandButton cmdThree
      Caption         =   "3"
      Height          =   375
      Left            =   1920
      TabIndex        =   5
      Top             =   2160
      Width           =   735
   End
   Begin VB.CommandButton cmdTwo
      Caption         =   "2"
      Height          =   375
      Left            =   1080
      TabIndex        =   4
      Top             =   2160
      Width           =   735
   End
   Begin VB.CommandButton cmdOne
      Caption         =   "1"
      Height          =   375
      Left            =   240
      TabIndex        =   2
      Top             =   2160
      Width           =   735
   End
   Begin VB.CommandButton cmdAbout
      Caption         =   "About Me"
      Height          =   495
      Left            =   240
      TabIndex        =   1
      Top             =   480
      Width           =   1335
   End
   Begin VB.CommandButton cmdClear
      Caption         =   "C"
      Height          =   495
      Left            =   1680
      TabIndex        =   3
      Top             =   480
      Width           =   855
   End
   Begin VB.TextBox txtDsplay
      Alignment       =   1  'Right Justify
      BeginProperty DataFormat
         Type            =   1
         Format          =   "#,##0"
         HaveTrueFalseNull=   0
         FirstDayOfWeek  =   0
         FirstWeekOfYear =   0
         LCID            =   1033
         SubFormatType   =   1
      EndProperty
      Enabled         =   0   'False
      Height          =   405
      Left            =   0
      MaxLength       =   32
      TabIndex        =   0
      Top             =   0
      Width           =   3090
   End
   Begin VB.Menu mnuFile
      Caption         =   "&File"
      Index           =   1
      Begin VB.Menu mnuFileExit
         Caption         =   "&Exit"
         Shortcut        =   ^X
      End
   End
   Begin VB.Menu mnuHelp
      Caption         =   "&Help"
      Begin VB.Menu mnuHelpAbout
         Caption         =   "&About Me"
      End
   End
End
Attribute VB_Name = "frmCalculator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Program :Calculator
' Purpose : Perform Simple Mathematical Calculations
' Written : 01st March 2004. by Muhammad Asim Zia
' Email : [[Email Removed]]
' (c) 2004 All Rights Reserved by Muhammad Asim

Dim num1 As Double
Dim num2 As Double
Dim operand As String
Dim op1 As String

Private Sub cmdAbout_Click()
    frmAbout.Show
End Sub

Private Sub cmdClear_Click()
    txtDsplay.Text = ""
    txtOp.Text = ""
End Sub

Private Sub cmdDivide_Click()
    If txtDsplay.Text = "" Then
        MsgBox "Please enter a number"
    Else
        txtOp.Text = "/"
        num1 = txtDsplay.Text
        txtDsplay.Text = ""
        operand = "/"
    End If
End Sub

Private Sub cmdEqual_Click()
    If txtDsplay.Text = "" Then
        MsgBox "Please enter two numbers"
    Else
        txtOp.Text = ""
        num2 = txtDsplay.Text
    If operand = "+" Then
        txtDsplay.Text = num1 + num2
    End If
    If operand = "-" Then
        txtDsplay.Text = num1 - num2
    End If
    If operand = "X" Then
        txtDsplay.Text = num1 * num2
    End If
    If operand = "/" And num2 <> 0 Then
        txtDsplay.Text = num1 / num2
    End If
        operand = "="
    End If
    op1 = "="
End Sub

Private Sub cmdMinus_Click()
    If txtDsplay.Text = "" Then
        MsgBox "Please enter a number"
    Else
        txtOp.Text = "-"
        num1 = txtDsplay.Text
        txtDsplay.Text = ""
        operand = "-"
    End If
End Sub

Private Sub cmdMultiply_Click()
    If txtDsplay.Text = "" Then
        MsgBox "Please enter a number"
    Else
        txtOp.Text = "X"
        num1 = txtDsplay.Text
        txtDsplay.Text = ""
        operand = "X"
    End If
End Sub

Private Sub cmdPlus_Click()
    If txtDsplay.Text = "" Then
        MsgBox "Please enter a number"
    Else
        txtOp.Text = "+"
        num1 = txtDsplay.Text
        txtDsplay.Text = ""
        operand = "+"
    End If
End Sub

Private Sub Form_Load()
    operand = ""
End Sub

Private Sub cmdOne_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "1"
End Sub

Private Sub cmdPoint_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "."
End Sub

Private Sub cmdSeven_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "7"
End Sub

Private Sub cmdSix_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "6"
End Sub

Private Sub cmdTwo_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "2"
End Sub
Private Sub cmdThree_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "3"
End Sub

Private Sub cmdZero_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "0"
End Sub

Private Sub cmdEight_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "8"
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdFive_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "5"
End Sub

Private Sub cmdFour_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "4"
End Sub

Private Sub cmdNine_Click()
    If op1 = "=" Then
    txtDsplay.Text = ""
    End If
    op1 = ""
    txtDsplay.Text = txtDsplay.Text + "9"
End Sub

Private Sub mnuFileExit_Click()
    Unload Me
End Sub

Private Sub mnuHelpAbout_Click()
    frmAbout.Show
End Sub

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.