📄 if_then2.frm
字号:
VERSION 5.00
Begin VB.Form if_then2
Caption = "方程计算"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 3240
TabIndex = 4
Top = 2040
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "计算"
Height = 495
Left = 1680
TabIndex = 3
Top = 2040
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "清除"
Height = 495
Left = 120
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 1
Top = 840
Width = 2055
End
Begin VB.Label Label1
Caption = "Y="
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 480
TabIndex = 0
Top = 840
Width = 615
End
End
Attribute VB_Name = "if_then2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Dim x As Double
x = Val(InputBox("请输入X的值:"))
If x < 1 Then
y = 1
ElseIf x <= 3 Then y = 2 * x
Else: y = x * x + 5 * x
End If
Text1.Text = y
End Sub
Private Sub Command1_Click()
Text1.Text = ""
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -