如何用VB做一个简单计算器 要求实现加减乘除乘方开方功能 用0~9按钮实现 类似WINDOWS系统自带的计算器 最好带图最好有声明 代码太多 看着晃~
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 01:07:31
如何用VB做一个简单计算器 要求实现加减乘除乘方开方功能 用0~9按钮实现 类似WINDOWS系统自带的计算器 最好带图最好有声明 代码太多 看着晃~
如何用VB做一个简单计算器 要求实现加减乘除乘方开方功能 用0~9按钮实现 类似WINDOWS系统自带的计算器 最好带图
最好有声明 代码太多 看着晃~
如何用VB做一个简单计算器 要求实现加减乘除乘方开方功能 用0~9按钮实现 类似WINDOWS系统自带的计算器 最好带图最好有声明 代码太多 看着晃~
用记事本把这段代码复制过去,然后另存为.frm就可以了
VERSION 5.00
Begin VB.Form frmMain
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 3 'Fixed Dialog
Caption = "简单计算器"
ClientHeight = 2430
ClientLeft = 45
ClientTop = 435
ClientWidth = 3150
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2430
ScaleWidth = 3150
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command10
Caption = "^"
Height = 375
Left = 1920
TabIndex = 22
Top = 1920
Width = 495
End
Begin VB.PictureBox picDisplay
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 255
Left = 120
ScaleHeight = 225
ScaleWidth = 2865
TabIndex = 19
Top = 120
Width = 2895
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BorderStyle = 0 'None
Height = 255
Left = 240
Locked = -1 'True
TabIndex = 20
Top = 0
Width = 2535
End
Begin VB.Label lblOperation
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 255
Left = 60
TabIndex = 21
Top = 0
Width = 255
End
End
Begin VB.CommandButton Command9
Caption = "退格"
Height = 375
Left = 1920
TabIndex = 18
Top = 480
Width = 495
End
Begin VB.CommandButton Command8
Caption = "清零"
Height = 375
Left = 2520
TabIndex = 17
Top = 480
Width = 495
End
Begin VB.CommandButton cmdDot
Caption = "."
Height = 375
Left = 120
TabIndex = 16
Top = 1920
Width = 495
End
Begin VB.CommandButton Command7
Caption = "Sqrt"
Height = 375
Left = 2520
TabIndex = 15
Top = 1920
Width = 495
End
Begin VB.CommandButton Command6
Caption = "="
Height = 375
Left = 1320
TabIndex = 14
Top = 1920
Width = 495
End
Begin VB.CommandButton Command5
Caption = "/"
Height = 375
Left = 2520
TabIndex = 13
Top = 1440
Width = 495
End
Begin VB.CommandButton Command4
Caption = "*"
Height = 375
Left = 1920
TabIndex = 12
Top = 1440
Width = 495
End
Begin VB.CommandButton Command3
Caption = "-"
Height = 375
Left = 2520
TabIndex = 11
Top = 960
Width = 495
End
Begin VB.CommandButton Command2
Caption = "+"
Height = 375
Left = 1920
TabIndex = 10
Top = 960
Width = 495
End
Begin VB.CommandButton Command1
Caption = "9"
Height = 375
Index = 9
Left = 1320
TabIndex = 9
Top = 480
Width = 495
End
Begin VB.CommandButton Command1
Caption = "8"
Height = 375
Index = 8
Left = 720
TabIndex = 8
Top = 480
Width = 495
End
Begin VB.CommandButton Command1
Caption = "7"
Height = 375
Index = 7
Left = 120
TabIndex = 7
Top = 480
Width = 495
End
Begin VB.CommandButton Command1
Caption = "6"
Height = 375
Index = 6
Left = 1320
TabIndex = 6
Top = 960
Width = 495
End
Begin VB.CommandButton Command1
Caption = "5"
Height = 375
Index = 5
Left