*/
Written some cool source code? Upload it to Programmer's Heaven.
*/

View \frmCalc.frm

WinDOS Shell 0.1A

Submitted By: Shehbaz
Rating: starstarstarstarstar (Rate It)


VERSION 5.00
Begin VB.Form frmCalc
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   Caption         =   "Calculator"
   ClientHeight    =   5460
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   3960
   ControlBox      =   0   'False
   LinkTopic       =   "calculatorx"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "frmCalc.frx":0000
   ScaleHeight     =   5460
   ScaleWidth      =   3960
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.Timer Timer1
      Interval        =   350
      Left            =   4485
      Top             =   4515
   End
   Begin VB.TextBox Hidden
      Height          =   375
      Left            =   4320
      TabIndex        =   24
      Top             =   5265
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.TextBox equal_dec
      Height          =   285
      Left            =   4050
      TabIndex        =   23
      Text            =   "n"
      Top             =   3480
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.TextBox dec_choice
      Height          =   285
      Left            =   4170
      TabIndex        =   22
      Text            =   "n"
      Top             =   3600
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.TextBox decider
      Height          =   285
      Left            =   4050
      TabIndex        =   21
      Top             =   1320
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.TextBox num2
      Height          =   375
      Left            =   4050
      TabIndex        =   20
      Text            =   "0"
      Top             =   1800
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.TextBox num1
      Height          =   375
      Left            =   4050
      TabIndex        =   19
      Text            =   "0"
      Top             =   840
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton equals_old
      Caption         =   "="
      Height          =   375
      Left            =   4050
      TabIndex        =   18
      ToolTipText     =   "Equals"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton Clear_old
      Caption         =   "C"
      Height          =   375
      Left            =   4050
      TabIndex        =   17
      ToolTipText     =   "Clear Screen"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton add_old
      Caption         =   "+"
      Height          =   375
      Left            =   4050
      TabIndex        =   16
      ToolTipText     =   "Addition"
      Top             =   3600
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton subtract_old
      Caption         =   "-"
      Height          =   375
      Left            =   4050
      TabIndex        =   15
      ToolTipText     =   "Subtract"
      Top             =   3360
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton multiply_old
      Caption         =   "*"
      Height          =   375
      Left            =   4170
      TabIndex        =   14
      ToolTipText     =   "Multiply"
      Top             =   3360
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton divide_old
      Caption         =   "/"
      Height          =   375
      Left            =   4050
      TabIndex        =   13
      ToolTipText     =   "Divide"
      Top             =   3600
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton decimal_old
      Caption         =   "."
      Height          =   375
      Left            =   4050
      TabIndex        =   12
      ToolTipText     =   "Decimal Point"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton plus_minus_old
      Caption         =   "+/-"
      Height          =   375
      Left            =   4170
      TabIndex        =   11
      ToolTipText     =   "Turn number in to a minus number"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton zero_old
      Caption         =   "0"
      Height          =   375
      Left            =   4170
      TabIndex        =   10
      ToolTipText     =   "Zero"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton nine_old
      Caption         =   "9"
      Height          =   375
      Left            =   4050
      TabIndex        =   9
      ToolTipText     =   "Nine"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton eight_old
      Caption         =   "8"
      Height          =   375
      Left            =   4050
      TabIndex        =   8
      ToolTipText     =   "Eight"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton seven_old
      Caption         =   "7"
      Height          =   375
      Left            =   4050
      TabIndex        =   7
      ToolTipText     =   "Seven"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton six_old
      Caption         =   "6"
      Height          =   375
      Left            =   4050
      TabIndex        =   6
      ToolTipText     =   "Six"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton five_old
      Caption         =   "5"
      Height          =   375
      Left            =   4050
      TabIndex        =   5
      ToolTipText     =   "Five"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton four_old
      Caption         =   "4"
      Height          =   375
      Left            =   4050
      TabIndex        =   4
      ToolTipText     =   "Four"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton Three_old
      Caption         =   "3"
      Height          =   375
      Left            =   4050
      TabIndex        =   3
      ToolTipText     =   "Three"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton two_old
      Caption         =   "2"
      Height          =   375
      Left            =   4050
      TabIndex        =   2
      ToolTipText     =   "Two"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.CommandButton one_old
      Caption         =   "1"
      Height          =   375
      Left            =   4050
      TabIndex        =   1
      ToolTipText     =   "One"
      Top             =   3480
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.TextBox display
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF80&
      Height          =   480
      Left            =   270
      TabIndex        =   0
      ToolTipText     =   "Calculator Screen"
      Top             =   1065
      Width           =   2445
   End
   Begin VB.Shape Shape19
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2085
      Top             =   4650
      Width           =   615
   End
   Begin VB.Label Ans
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "ANS"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   255
      Left            =   2160
      TabIndex        =   44
      Top             =   4845
      Width           =   495
   End
   Begin VB.Shape Shape18
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2955
      Top             =   990
      Width           =   615
   End
   Begin VB.Shape Shape17
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2955
      Top             =   1725
      Width           =   615
   End
   Begin VB.Shape Shape16
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2955
      Top             =   2490
      Width           =   615
   End
   Begin VB.Shape Shape15
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2970
      Top             =   3210
      Width           =   615
   End
   Begin VB.Shape Shape14
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2955
      Top             =   3945
      Width           =   615
   End
   Begin VB.Shape Shape13
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2955
      Top             =   4665
      Width           =   615
   End
   Begin VB.Shape Shape12
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2085
      Top             =   1710
      Width           =   615
   End
   Begin VB.Shape Shape11
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   1200
      Top             =   1710
      Width           =   615
   End
   Begin VB.Shape Shape10
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   285
      Top             =   1710
      Width           =   615
   End
   Begin VB.Shape Shape9
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2085
      Top             =   2475
      Width           =   615
   End
   Begin VB.Shape Shape8
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   1200
      Top             =   2475
      Width           =   615
   End
   Begin VB.Shape Shape7
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   285
      Top             =   2475
      Width           =   615
   End
   Begin VB.Shape Shape6
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2100
      Top             =   3195
      Width           =   615
   End
   Begin VB.Shape Shape5
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   1215
      Top             =   3195
      Width           =   615
   End
   Begin VB.Shape Shape4
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   300
      Top             =   3195
      Width           =   615
   End
   Begin VB.Shape Shape3
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   2085
      Top             =   3930
      Width           =   615
   End
   Begin VB.Shape Shape2
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   1200
      Top             =   3930
      Width           =   615
   End
   Begin VB.Shape Shape1
      BorderColor     =   &H0000FF00&
      Height          =   615
      Left            =   285
      Top             =   3930
      Width           =   615
   End
   Begin VB.Label decimalx
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "."
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   2205
      TabIndex        =   43
      Top             =   4050
      Width           =   375
   End
   Begin VB.Label plus_minus
      BackStyle       =   0  'Transparent
      Caption         =   "+/-"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   1320
      TabIndex        =   42
      Top             =   4050
      Width           =   375
   End
   Begin VB.Label zero
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   405
      TabIndex        =   41
      Top             =   4050
      Width           =   375
   End
   Begin VB.Label equals
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "="
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3075
      TabIndex        =   40
      Top             =   4785
      Width           =   375
   End
   Begin VB.Label add
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "+"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3075
      TabIndex        =   39
      Top             =   4065
      Width           =   375
   End
   Begin VB.Label subtract
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "-"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3090
      TabIndex        =   38
      Top             =   3330
      Width           =   375
   End
   Begin VB.Label multiply
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "*"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3075
      TabIndex        =   37
      Top             =   2610
      Width           =   375
   End
   Begin VB.Label divide
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "/"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3075
      TabIndex        =   36
      Top             =   1845
      Width           =   375
   End
   Begin VB.Label clear
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "C"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   3075
      TabIndex        =   35
      Top             =   1110
      Width           =   375
   End
   Begin VB.Label nine
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "9"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   2220
      TabIndex        =   34
      Top             =   3315
      Width           =   375
   End
   Begin VB.Label eight
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "8"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   1335
      TabIndex        =   33
      Top             =   3315
      Width           =   375
   End
   Begin VB.Label seven
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "7"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   420
      TabIndex        =   32
      Top             =   3315
      Width           =   375
   End
   Begin VB.Label six
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "6"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   2205
      TabIndex        =   31
      Top             =   2595
      Width           =   375
   End
   Begin VB.Label five
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "5"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   1320
      TabIndex        =   30
      Top             =   2595
      Width           =   375
   End
   Begin VB.Label four
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "4"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   405
      TabIndex        =   29
      Top             =   2595
      Width           =   375
   End
   Begin VB.Label three
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "3"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   2205
      TabIndex        =   28
      Top             =   1830
      Width           =   375
   End
   Begin VB.Label two
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "2"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   1320
      TabIndex        =   27
      Top             =   1830
      Width           =   375
   End
   Begin VB.Label one
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "1"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   375
      Left            =   405
      TabIndex        =   26
      Top             =   1830
      Width           =   375
   End
   Begin VB.Label closex
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Close"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF00&
      Height          =   255
      Left            =   405
      TabIndex        =   25
      Top             =   4830
      Width           =   615
   End
   Begin VB.Shape Shape20
      BorderColor     =   &H0000FF00&
      Height          =   570
      Left            =   285
      Top             =   4680
      Width           =   855
   End
End
Attribute VB_Name = "frmCalc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub add_Click()

num1 = display
decider.Text = "+"
display = ""
display.SetFocus

dec_choice = "n"

End Sub

Private Sub add_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

add.ForeColor = &HFF0000
Shape14.BorderColor = &HFF0000

End Sub

Private Sub Ans_Click()

display.Text = Hidden.Text

End Sub

Private Sub Ans_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Ans.ForeColor = &HFF0000
Shape19.BorderColor = &HFF0000

End Sub

Private Sub Clear_Click()

display = ""
num1 = ""
num2 = ""
decider = ""
dec_choice = "n"
equal_dec = "n"

display.SetFocus

End Sub

Private Sub clear_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

clear.ForeColor = &HFF0000
Shape18.BorderColor = &HFF0000

End Sub

Private Sub closex_Click()

Unload Me

End Sub

Private Sub closex_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

closex.ForeColor = &HFF0000
Shape20.BorderColor = &HFF0000

End Sub

Private Sub decimalx_Click()

On Error GoTo number_problem
   
    If dec_choice = "Y" Then
        Exit Sub
    End If
   
    dec_choice.Text = "Y"
    display = display.Text & "."

Exit Sub
number_problem:
    MsgBox Error & " (" & err & ")"
Exit Sub

End Sub

Private Sub decimal_Click()

End Sub

Private Sub decimalx_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
decimalx.ForeColor = &HFF0000
Shape3.BorderColor = &HFF0000
End Sub

Private Sub display_KeyPress(KeyAscii As Integer)

On Error GoTo key_error

'MsgBox KeyAscii

If KeyAscii = 27 Then
    closex.ForeColor = &HFF0000
    Shape20.BorderColor = &HFF0000
    Unload Me
End If

If KeyAscii = 46 Then
    decimalx.ForeColor = &HFF0000
    Shape3.BorderColor = &HFF0000
End If

If KeyAscii = 48 Then
    zero.ForeColor = &HFF0000
    Shape1.BorderColor = &HFF0000
End If

If KeyAscii = 49 Then
    one.ForeColor = &HFF0000
    Shape10.BorderColor = &HFF0000
End If

If KeyAscii = 50 Then