⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 03428780.txt

📁 实现简单的加减乘除功能 实现简单的加减乘除功能实现简单的加减乘除功能实现简单的加减乘除功能
💻 TXT
📖 第 1 页 / 共 2 页
字号:
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   8
         Left            =   640
         TabIndex        =   9
         Top             =   160
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "7"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   7
         Left            =   80
         TabIndex        =   8
         Top             =   160
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "6"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   6
         Left            =   1200
         TabIndex        =   7
         Top             =   720
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H80000009&
         Caption         =   "5"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   5
         Left            =   640
         TabIndex        =   6
         Top             =   720
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "4"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   4
         Left            =   80
         TabIndex        =   5
         Top             =   720
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "3"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   3
         Left            =   1200
         TabIndex        =   4
         Top             =   1280
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "2"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   2
         Left            =   640
         TabIndex        =   3
         Top             =   1280
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "1"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   1
         Left            =   80
         TabIndex        =   2
         Top             =   1280
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   0
         Left            =   80
         TabIndex        =   1
         Top             =   1830
         Width           =   495
      End
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   345
      Left            =   120
      TabIndex        =   12
      Top             =   120
      Width           =   2835
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "编辑(&E)"
      Begin VB.Menu mnuCopy 
         Caption         =   "复制(&C)"
      End
      Begin VB.Menu mnuZhantie 
         Caption         =   "粘贴(&V)"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim s As String
Dim a, c As Single
Dim b, d As Integer
Private Sub Command1_Click(Index As Integer)
 d = Index
 If Index < 10 Then
   Label1.Caption = Label1.Caption & Index
 Else
   Command2.Enabled = True
   a = Val(Label1.Caption)
   Label1.Caption = ""
   b = Index
 End If
End Sub

Private Sub Command2_Click()
 Label1.Caption = Label1.Caption & "."
 Command2.Enabled = False
End Sub

Private Sub Command3_Click()
 Command2.Enabled = True
 c = Val(Label1.Caption)
 Select Case b
   Case 16
     Label1.Caption = a + c
   Case 17
     Label1.Caption = a - c
   Case 18
     Label1.Caption = a * c
   Case 19
     If c <> 0 Then
       Label1.Caption = a / c
     Else
       Label1.Caption = "除数不能为零"
     End If
  End Select
End Sub

Private Sub Command4_Click(Index As Integer)
  Command2.Enabled = True
  If Index <> 3 Then
    a = Val(Label1.Caption)
    Select Case Index
      Case 0
        If a >= 0 Then
          Label1.Caption = a ^ (1 / 2)
          Command2.Enabled = False
        Else
          Label1.Caption = "被开方数应不小于零"
        End If
      Case 1
        Label1.Caption = 0 - Val(Label1.Caption)
      Case 2
        If a <> 0 Then
          Label1.Caption = 1 / a
          Command2.Enabled = False
        Else
          Label1.Caption = "零不能求倒数"
        End If
    End Select
  Else
    Label1.Caption = ""
  End If
End Sub

Private Sub mnuCopy_Click()
s = Label1.Caption
End Sub



Private Sub mnuZhantie_Click()
Label1.Caption = s
End Sub

Public Function Two_jz()
Form1.Height = 3665
Frame1.Height = 2400
End Function

Public Function chenge(k As Integer)
 For d = k To 9
  Command1(d).Enabled = False
 Next d
 For d = 1 To k - 1
  Command1(d).Enabled = True
 Next d
End Function

Private Sub Option1_Click()

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -