practice6_2.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 96 行
FRM
96 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2265
ClientLeft = 60
ClientTop = 345
ClientWidth = 4605
LinkTopic = "Form1"
ScaleHeight = 2265
ScaleWidth = 4605
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 3
Top = 1200
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "计算"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 2
Top = 1200
Width = 855
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 0
Top = 360
Width = 2175
End
Begin VB.Label Label1
Caption = "N="
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 1
Top = 480
Width = 375
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()
s = 0
n = Val(Text1.Text)
k = 2
For i = 1 To 2 * n - 1 Step 2
s = s + (-1) ^ k * 1 / i
k = k + 1
Next i
s = 4 * s
Text2.Text = Format(s, "0.0000")
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?