practice8_1.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 167 行
FRM
167 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4050
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4050
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
Locked = -1 'True
TabIndex = 4
Top = 2280
Width = 1815
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 2
Top = 1560
Width = 1815
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 1
Top = 840
Width = 1815
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 0
Top = 120
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "y="
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 3
Top = 2280
Width = 735
End
Begin VB.Label Label3
Caption = "p="
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 7
Top = 1560
Width = 615
End
Begin VB.Label Label2
Caption = "n="
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 6
Top = 840
Width = 615
End
Begin VB.Label Label1
Caption = "m="
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 5
Top = 120
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function f(n)
Sum = 0
For i = 1 To n
Sum = Sum + i
Next i
f = Sum
End Function
Private Sub Command1_Click()
m = Val(Text1.Text)
n = Val(Text2.Text)
p = Val(Text3.Text)
y = (f(m) + f(n)) / f(p)
Text4.Text = Format(y, "0.0000")
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?