📄 求矩形面积子过程.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "例[8-2]子过程——求矩形面积"
ClientHeight = 1755
ClientLeft = 60
ClientTop = 345
ClientWidth = 4290
LinkTopic = "Form1"
ScaleHeight = 1755
ScaleWidth = 4290
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 2374
TabIndex = 5
Top = 990
Width = 1695
End
Begin VB.TextBox Text2
Height = 495
Left = 934
TabIndex = 4
Top = 990
Width = 1095
End
Begin VB.TextBox Text1
Height = 495
Left = 934
TabIndex = 3
Top = 270
Width = 1095
End
Begin VB.Label Label3
Height = 495
Left = 2381
TabIndex = 2
Top = 390
Width = 1695
End
Begin VB.Label Label2
Caption = "矩形宽:"
Height = 375
Left = 214
TabIndex = 1
Top = 990
Width = 735
End
Begin VB.Label Label1
Caption = "矩形长:"
Height = 375
Left = 214
TabIndex = 0
Top = 390
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()
Call area(Val(Text1), Val(Text2))
End Sub
Private Sub area(a As Single, b As Single) '子过程
Dim sum As Double
sum = a * b
Label3.Caption = "矩形面积为: " + Str(sum)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -