📄 例题5.6 计算购物款.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "例题5.6 计算购物款"
ClientHeight = 2445
ClientLeft = 60
ClientTop = 450
ClientWidth = 4365
LinkTopic = "Form1"
ScaleHeight = 2445
ScaleWidth = 4365
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "结束"
Height = 495
Left = 2865
TabIndex = 7
Top = 1275
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "开始"
Height = 495
Left = 2865
TabIndex = 6
Top = 435
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
Left = 1305
TabIndex = 5
Top = 1635
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
Left = 1305
TabIndex = 4
Top = 915
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 1305
TabIndex = 3
Top = 195
Width = 1215
End
Begin VB.Label Label3
Caption = "实付款"
Height = 495
Left = 345
TabIndex = 2
Top = 1755
Width = 735
End
Begin VB.Label Label2
Caption = "折扣"
Height = 495
Left = 345
TabIndex = 1
Top = 1035
Width = 735
End
Begin VB.Label Label1
Caption = "应付款"
Height = 495
Left = 345
TabIndex = 0
Top = 315
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim s As Single, d As Single
m = InputBox("请输入应付款:")
Select Case m
Case Is < 250
d = 0
Case Is < 500
d = 0.05
Case Is < 1000
d = 0.075
Case Is < 2000
d = 0.1
Case Else
d = 0.15
End Select
Text1.Text = Str(m)
Text2.Text = Str(d)
Text3.Text = Str(m * (1 - d))
End Sub
Private Sub Command2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -