VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00808000&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Калькулятор"
   ClientHeight    =   3765
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6855
   Icon            =   "Калькулятор.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3765
   ScaleWidth      =   6855
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame2 
      BackColor       =   &H00808000&
      Height          =   2175
      Left            =   4560
      TabIndex        =   24
      Top             =   1440
      Width           =   2055
      Begin VB.CommandButton Command32 
         Caption         =   "Tan"
         Height          =   375
         Left            =   1320
         TabIndex        =   35
         Top             =   1680
         Width           =   495
      End
      Begin VB.CommandButton Command31 
         Caption         =   "Cos"
         Height          =   375
         Left            =   1320
         TabIndex        =   34
         Top             =   1200
         Width           =   495
      End
      Begin VB.CommandButton Command30 
         Cancel          =   -1  'True
         Caption         =   "Sin"
         Height          =   375
         Left            =   1320
         TabIndex        =   33
         Top             =   720
         Width           =   495
      End
      Begin VB.CommandButton Command28 
         Caption         =   "="
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1320
         TabIndex        =   30
         Top             =   240
         Width           =   495
      End
      Begin VB.CommandButton Command27 
         Caption         =   "v"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   29
         Top             =   1200
         Width           =   855
      End
      Begin VB.CommandButton Command26 
         Caption         =   "*"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   28
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command25 
         Caption         =   "/"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   27
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command24 
         Caption         =   "-"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   26
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command23 
         Caption         =   "+"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   25
         Top             =   240
         Width           =   375
      End
   End
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H00808000&
      ForeColor       =   &H80000008&
      Height          =   2175
      Left            =   240
      TabIndex        =   22
      Top             =   1440
      Width           =   3975
      Begin VB.CommandButton Command22 
         Caption         =   "E"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2520
         TabIndex        =   23
         Top             =   1680
         Width           =   375
      End
      Begin VB.CommandButton Command21 
         Caption         =   "+"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   21
         Top             =   1680
         Width           =   375
      End
      Begin VB.CommandButton Command20 
         Caption         =   "-"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1560
         TabIndex        =   20
         Top             =   1680
         Width           =   375
      End
      Begin VB.CommandButton Command19 
         Caption         =   "Backsp"
         Height          =   375
         Left            =   3000
         TabIndex        =   19
         Top             =   1200
         Width           =   855
      End
      Begin VB.CommandButton Command18 
         Caption         =   "Clear"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3000
         TabIndex        =   18
         Top             =   1680
         Width           =   855
      End
      Begin VB.CommandButton Command17 
         Caption         =   ","
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1080
         TabIndex        =   17
         Top             =   1680
         Width           =   375
      End
      Begin VB.CommandButton Command16 
         Caption         =   "F"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2520
         TabIndex        =   16
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command15 
         Caption         =   "E"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   15
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command14 
         Caption         =   "D"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1560
         TabIndex        =   14
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command13 
         Caption         =   "C"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2520
         TabIndex        =   13
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command12 
         Caption         =   "B"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   12
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command11 
         Caption         =   "A"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1560
         TabIndex        =   11
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command10 
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   10
         Top             =   1680
         Width           =   375
      End
      Begin VB.CommandButton Command9 
         Caption         =   "9"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1080
         Style           =   1  'Graphical
         TabIndex        =   9
         Top             =   1200
         Width           =   375
      End
      Begin VB.CommandButton Command8 
         Caption         =   "8"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         Style           =   1  'Graphical
         TabIndex        =   8
         Top             =   1200
         Width           =   375
      End
      Begin VB.CommandButton Command7 
         Caption         =   "7"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   1200
         Width           =   375
      End
      Begin VB.CommandButton Command6 
         Caption         =   "6"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1080
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command5 
         Caption         =   "5"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command4 
         Caption         =   "4"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton Command3 
         BackColor       =   &H00C0C0C0&
         Caption         =   "3"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1080
         MaskColor       =   &H00404040&
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command2 
         BackColor       =   &H00C0C0C0&
         Caption         =   "2"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   240
         Width           =   375
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "1"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         MaskColor       =   &H00404040&
         Style           =   1  'Graphical
         TabIndex        =   0
         Top             =   240
         Width           =   375
      End
   End
   Begin VB.TextBox Text1 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00808000&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   495
      Left            =   240
      TabIndex        =   1
      Text            =   "0,0"
      Top             =   600
      Width           =   5415
   End
   Begin VB.CommandButton Command29 
      Caption         =   "Выкл"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6000
      MousePointer    =   1  'Arrow
      TabIndex        =   31
      Top             =   600
      Width           =   735
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      Caption         =   "Калькулятор Крутой"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00F21E83&
      Height          =   375
      Left            =   240
      TabIndex        =   32
      Top             =   120
      Width           =   5415
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim zz As String
Dim info As String
Dim z As Single
Dim Y As Single
Dim met As Integer
Dim f As Integer

Private Sub Command1_Click()
'Command1_MouseDown (0, 0, 345, 345)
Multiply 1

End Sub


Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'If Command1 = False Then Command1 = True 'Else Command1 = False
End Sub

Private Sub Command10_Click()
Multiply 0


End Sub

Private Sub Command17_Click()
Dim i As Integer
Dim m As Integer
m = 0
For i = 1 To Len(zz)
If Mid(zz, i, 1) = "." Then m = m + 1
Next
If m < 1 Then zz = zz + "."
Text1.Text = zz


End Sub


Private Sub Command18_Click()
zz = ""
Y = 0
z = 0
met = 0
f = 0

Text1.Text = zz
End Sub

Private Sub Command19_Click()
If Len(zz) >= 1 Then zz = Left(zz, Len(zz) - 1)
If Len(zz) < 1 Then zz = "": Y = Val(zz)
Text1.Text = zz

End Sub

Private Sub Command2_Click()
Multiply 2

End Sub

Private Sub Command20_Click()
If Len(zz) = 0 Or Right(zz, 1) = "E" Then zz = zz + "-"
Text1.Text = zz

'info = info + "-"
End Sub

Private Sub Command21_Click()
If Len(zz) = 0 Then zz = "+"
Text1.Text = zz

'info = info + "+"
End Sub

Private Sub Command22_Click()
Dim i As Integer
Dim m As Integer
m = 0
For i = 1 To Len(zz)

If Mid(zz, i, 1) = "E" Then m = m + 1
Next

If m < 1 Then zz = zz + "E"
m = 0
Text1.Text = zz

'info = info + "E"
End Sub

Private Sub Command23_Click()
If f <> 1 Then Y = Val(zz)
z = 0
met = 0
If f = 1 Then Command28_Click
If f = 1 Then Y = Val(zz)
f = 1
zz = ""
End Sub

Private Sub Command24_Click()
If f <> 1 Then Y = -Val(zz)
z = 0
met = 3
If f = 1 Then Command28_Click
If f = 1 Then Y = -Val(zz)
f = 1
zz = ""
End Sub

Private Sub Command25_Click()
If f <> 1 Then Y = Val(zz)
z = 0
met = 1
If f = 1 Then Command28_Click
If f = 1 Then Y = Val(zz)

f = 1
zz = ""

End Sub

Private Sub Command26_Click()
If f <> 1 Then Y = Val(zz)

z = 0
met = 2
If f = 1 Then Command28_Click
If f = 1 Then Y = Val(zz)
zz = ""
f = 1

End Sub

Private Sub Command27_Click()
If Val(zz) >= 0 Then
Y = Sqr(Val(zz))
zz = Str(Y)
z = 0
Text1.Text = Str(Y)
Else: Beep: Text1.Text = info
End If
End Sub
'результат
Private Sub Command28_Click()
If Y >= 0 And met = 0 Then
Y = Y + Val(zz)
zz = Str(Y)
End If
If Y < 0 And met = 3 Then
Y = -Y - Val(zz)
zz = Str(Y)
End If

If met = 1 And Val(zz) <> 0 Then
Y = Y / Val(zz)
zz = Str(Y)
End If

If met = 2 Then
Y = Y * Val(zz)
zz = Str(Y)
End If

If met = 1 And Val(zz) = 0 Then zz = info

Text1.Text = zz


End Sub

Private Sub Command29_Click()
Beep
End
End Sub

Private Sub Command3_Click()
Multiply 3
'info = info + "3"
End Sub

Private Sub Command30_Click()
Y = Sin(Val(zz) * 3.141528 / 180)
zz = Str(Y)
z = 0

Text1.Text = Str(Y)

End Sub

Private Sub Command31_Click()
Y = Cos(Val(zz) * 3.141528 / 180)
zz = Str(Y)
z = 0

Text1.Text = Str(Y)

End Sub

Private Sub Command32_Click()
If Val(zz) <> 90 Then
Y = Tan(Val(zz) * 3.141528 / 180)
zz = Str(Y)
z = 0
Text1.Text = Str(Y)
Else: Text1.Text = info
End If
End Sub

Private Sub Command4_Click()
Multiply 4
'info = info + "4"
End Sub

Private Sub Command5_Click()
Multiply 5
'info = info + "5"
End Sub

Private Sub Command6_Click()
Multiply 6
'info = info + "6"
End Sub

Private Sub Command7_Click()
Multiply 7
'info = info + "7"
End Sub

Private Sub Command8_Click()
Multiply 8
'info = info + "8"
End Sub

Private Sub Command9_Click()
Multiply 9
'info = info + "9"

End Sub

Private Sub Form_Load()
Text1.Text = "Привет User"
info = "Ты что? Круче Крутого?"
met = 0
f = 0
End Sub

Public Sub Multiply(X As Single)
'Dim zz
z = X
zz = zz + Str(Right(z, 1))
'If Len(zz) >= 42 Then zz = Left(zz, Len(zz) - 1)
Text1.Text = zz

End Sub

