📄 mainform.frm
字号:
VERSION 5.00
Begin VB.Form MainForm
BackColor = &H00FF8080&
Caption = "Polynomial functions "
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 5940
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 5940
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command1
Caption = "Go"
Height = 375
Left = 3240
TabIndex = 10
Top = 2640
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "Exit"
Height = 375
Left = 4440
TabIndex = 9
Top = 2640
Width = 1095
End
Begin VB.TextBox Order
BeginProperty Font
Name = "Times New Roman"
Size = 8.25
Charset = 161
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 280
Index = 1
Left = 5040
TabIndex = 6
Top = 1440
Width = 495
End
Begin VB.TextBox Order
BeginProperty Font
Name = "Times New Roman"
Size = 8.25
Charset = 161
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 280
Index = 0
Left = 5040
TabIndex = 5
Top = 960
Width = 495
End
Begin VB.OptionButton Option
BackColor = &H00FF8080&
Caption = "Division"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFC0&
Height = 495
Index = 2
Left = 240
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.OptionButton Option
BackColor = &H00FF8080&
Caption = "Multiplication"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFC0&
Height = 495
Index = 1
Left = 240
TabIndex = 3
Top = 1200
Width = 1935
End
Begin VB.OptionButton Option
BackColor = &H00FF8080&
Caption = "Addition"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFC0&
Height = 495
Index = 0
Left = 240
TabIndex = 2
Top = 720
Value = -1 'True
Width = 1215
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
BackColor = &H00FF8080&
Caption = "Added:"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFC0&
Height = 255
Left = 3120
TabIndex = 8
Top = 1440
Width = 1815
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BackColor = &H00FF8080&
Caption = "Summand :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFC0&
Height = 255
Left = 3120
TabIndex = 7
Top = 960
Width = 1815
End
Begin VB.Label Label2
BackColor = &H00FF8080&
Caption = "Choose Polynomial's Order :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 255
Left = 3000
TabIndex = 1
Top = 240
Width = 2775
End
Begin VB.Label Label1
BackColor = &H00FF8080&
Caption = "Choose Operation :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 161
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 255
Left = 120
TabIndex = 0
Top = 240
Width = 2175
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'email: takisfmf@yahoo.gr
'for more source code visit
'http://www.geocities.com/takisfmf/index.html
Dim SelectedOperation
Private Sub Form_Load()
Order(0).Text = "0"
Order(1).Text = "0"
End Sub
Private Sub Command1_Click()
A_PolynomialOrder = GetValue(Order(0).Text)
B_PolynomialOrder = GetValue(Order(1).Text)
If A_PolynomialOrder < 0 Or B_PolynomialOrder < 0 Then MsgBox "Polynomial's Order must be Greater or equal to 0", vbCritical: Exit Sub
If A_PolynomialOrder > 12 Or B_PolynomialOrder > 12 Then MsgBox "Polynomial's Order must be less or equal to 12", vbCritical: Exit Sub
Select Case SelectedOperation
Case 0:
AdditionForm.Show modal, Me
Case 1:
MultiplicationForm.Show modal, Me
Case 2:
If GetValue(Order(0).Text) < GetValue(Order(1).Text) Then MsgBox "Divident Order must be Greater or equal of Diviter order!", vbCritical: Exit Sub
DivisionForm.Show modal, Me
End Select
End Sub
Private Sub Option_Click(Index As Integer)
Select Case Index
Case 0:
Label3.Caption = "Summand :"
Label4.Caption = "Added :"
SelectedOperation = 0
Case 1:
Label3.Caption = "Multiplicand :"
Label4.Caption = "Multiplier :"
SelectedOperation = 1
Case 2:
Label3.Caption = "Divident :"
Label4.Caption = "Divider :"
SelectedOperation = 2
End Select
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Terminate()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -