📄 jfc.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 6690
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 6690
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "结束"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3840
TabIndex = 18
Top = 2160
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "解下一个方程"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 240
TabIndex = 17
Top = 1680
Width = 2055
End
Begin VB.TextBox Text7
Height = 495
Left = 5280
TabIndex = 14
Top = 1320
Visible = 0 'False
Width = 735
End
Begin VB.TextBox Text6
Height = 615
Left = 5280
TabIndex = 13
Top = 480
Visible = 0 'False
Width = 735
End
Begin VB.TextBox Text5
Height = 495
Left = 3840
TabIndex = 10
Top = 1320
Width = 735
End
Begin VB.TextBox Text4
Height = 495
Left = 3840
TabIndex = 9
Top = 600
Width = 735
End
Begin VB.CommandButton Command1
Caption = "解这个方程"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 240
TabIndex = 6
Top = 840
Width = 2055
End
Begin VB.TextBox Text3
Height = 375
Left = 3120
TabIndex = 5
Top = 0
Width = 495
End
Begin VB.TextBox Text2
Height = 375
Left = 1680
TabIndex = 4
Top = 0
Width = 495
End
Begin VB.TextBox Text1
Height = 495
Left = 120
TabIndex = 3
Top = 0
Width = 495
End
Begin VB.Label Label9
Caption = "i"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6240
TabIndex = 16
Top = 1320
Visible = 0 'False
Width = 255
End
Begin VB.Label Label8
Caption = "i"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6120
TabIndex = 15
Top = 480
Visible = 0 'False
Width = 375
End
Begin VB.Label Label7
Caption = "-"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4800
TabIndex = 12
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label Label6
Caption = "+"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 11
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label Label5
Caption = "X2="
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 8
Top = 1320
Width = 615
End
Begin VB.Label Label4
Caption = "X1="
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 7
Top = 720
Width = 735
End
Begin VB.Label Label3
Caption = "=0"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
TabIndex = 2
Top = 120
Width = 495
End
Begin VB.Label Label2
Caption = "X+"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2280
TabIndex = 1
Top = 120
Width = 615
End
Begin VB.Label Label1
Caption = "X^2+"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 0
Top = 0
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()
Dim a, b, c, d, x1, x2 As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If a = 0 Then
If b = 0 Then
If c = 0 Then
MsgBox "有无数多个解", , "数据输入有误!"
Else
MsgBox "无解", , "数据输入有误!"
End If
Else
Label6.Visible = False
Label7.Visible = False
Text6.Visible = False
Text7.Visible = False
Label8.Visible = False
Label9.Visible = False
Label5.Visible = flase
Text5.Visible = False
Text4.Text = Str(-c / b)
End If
Else
If a < 0 Then
a = -a
b = -b
c = -c
End If
d = b * b - 4 * a * c
If d = 0 Then
Label5.Visible = True
Label6.Visible = True
Label7.Visible = False
Text6.Visible = False
Text7.Visible = False
Label8.Visible = False
Label9.Visible = False
Text4.Text = Str(-b / 2 / a)
Text5.Text = Str(-b / 2 / a)
Else
If d > 0 Then
Label6.Visible = False
Label7.Visible = False
Text6.Visible = False
Text7.Visible = False
Label8.Visible = False
Label9.Visible = False
Text4.Text = Str((-b + Sqr(d)) / 2 / a)
Text5.Text = Str((-b - Sqr(d)) / 2 / a)
Else
Label6.Visible = True
Label7.Visible = True
Text6.Visible = True
Text7.Visible = True
Label8.Visible = True
Label9.Visible = True
Text4.Text = Str(-b / 2 / a)
Text5.Text = Str(-b / 2 / a)
Text6.Text = Str(Sqr(-d))
Text7.Text = Str(Sqr(-d))
End If
End If
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Label6.Visible = False
Label7.Visible = False
Label8.Visible = False
Label9.Visible = False
Text6.Visible = False
Text7.Visible = False
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -