📄 计算sinx.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Calc Sin(x)"
ClientHeight = 2640
ClientLeft = 60
ClientTop = 345
ClientWidth = 6390
BeginProperty Font
Name = "Arial Black"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 2640
ScaleWidth = 6390
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Sinx="
Height = 495
Left = 120
TabIndex = 2
Top = 1200
Width = 1335
End
Begin VB.TextBox Text1
Height = 525
Left = 1560
TabIndex = 0
Top = 360
Width = 4335
End
Begin VB.Label Label4
Caption = "结果对比"
Height = 495
Left = 120
TabIndex = 5
Top = 1920
Width = 1335
End
Begin VB.Label Label3
BackColor = &H00FFFFC0&
Height = 495
Left = 1560
TabIndex = 4
Top = 1920
Width = 4335
End
Begin VB.Label Label2
BackColor = &H80000009&
Height = 495
Left = 1560
TabIndex = 3
Top = 1200
Width = 4335
End
Begin VB.Label Label1
Caption = "X="
Height = 615
Left = 840
TabIndex = 1
Top = 360
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
DefDbl A-Z
Private Sub Command1_Click()
Dim X, Sum, T, I%
X = Val(Text1)
T = X
I = 1
Do
Sum = Sum + T
T = -T * X * X / (2 * I) / (2 * I + 1)
I = I + 1
Loop While Abs(T) > 0.000000000000001
Label2.Caption = Format(Sum, "0.##################")
Label3.Caption = Format(Sin(X), "0.##################")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -