📄 complex.frm
字号:
VERSION 5.00
Object = "*\A..\SOURCE\FAST2002.vbp"
Begin VB.Form frmComplex
BorderStyle = 3 'Fixed Dialog
Caption = "Complex Numbers"
ClientHeight = 3330
ClientLeft = 45
ClientTop = 330
ClientWidth = 5265
Icon = "Complex.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3330
ScaleWidth = 5265
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.ListBox lstOperations
Height = 2985
ItemData = "Complex.frx":0442
Left = 3465
List = "Complex.frx":0473
TabIndex = 13
Top = 180
Width = 1635
End
Begin VB.TextBox txtReal
BackColor = &H8000000F&
Height = 330
Index = 2
Left = 135
Locked = -1 'True
TabIndex = 12
Top = 2250
Width = 690
End
Begin VB.TextBox txtForm
BackColor = &H8000000F&
Height = 330
Index = 2
Left = 1800
Locked = -1 'True
TabIndex = 11
Top = 2250
Width = 1230
End
Begin VB.TextBox txtImag
BackColor = &H8000000F&
Height = 330
Index = 2
Left = 945
Locked = -1 'True
TabIndex = 10
Top = 2250
Width = 690
End
Begin VB.CommandButton cmdCalc
Caption = "&Calc"
Height = 375
Left = 1350
TabIndex = 8
Top = 2790
Width = 1725
End
Begin VB.TextBox txtForm
BackColor = &H8000000F&
Height = 330
Index = 1
Left = 1800
Locked = -1 'True
TabIndex = 7
Top = 1170
Width = 1230
End
Begin VB.TextBox txtImag
Height = 330
Index = 1
Left = 945
TabIndex = 6
Text = "4"
Top = 1170
Width = 690
End
Begin VB.TextBox txtReal
Height = 330
Index = 1
Left = 135
TabIndex = 4
Text = "2"
Top = 1170
Width = 690
End
Begin VB.TextBox txtForm
BackColor = &H8000000F&
Height = 330
Index = 0
Left = 1800
Locked = -1 'True
TabIndex = 2
Top = 405
Width = 1230
End
Begin VB.TextBox txtImag
Height = 330
Index = 0
Left = 945
TabIndex = 1
Text = "7"
Top = 405
Width = 690
End
Begin VB.TextBox txtReal
Height = 330
Index = 0
Left = 135
TabIndex = 0
Text = "10"
Top = 405
Width = 690
End
Begin FLWGraphMath.FWComplex objComplex
Left = 180
Top = 2820
_ExtentX = 820
_ExtentY = 820
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Result"
Height = 195
Index = 2
Left = 135
TabIndex = 9
Top = 2040
Width = 450
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Number 2"
Height = 195
Index = 1
Left = 135
TabIndex = 5
Top = 945
Width = 690
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Number 1"
Height = 195
Index = 0
Left = 135
TabIndex = 3
Top = 180
Width = 690
End
End
Attribute VB_Name = "frmComplex"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim n1 As New FLWGraphMath.IFWComplexNumber
Dim n2 As New FLWGraphMath.IFWComplexNumber
Private Sub cmdCalc_Click()
Dim n3 As New FLWGraphMath.IFWComplexNumber
Dim strBuffer As String
n1.Real = txtReal(0)
n1.Imaginary = txtImag(0)
txtForm(0) = n1.DispForm
n2.Real = txtReal(1)
n2.Imaginary = txtImag(1)
txtForm(1) = n2.DispForm
Select Case lstOperations.ListIndex
Case 0
Set n3 = objComplex.cxAdd(n1, n2)
Case 1
Set n3 = objComplex.cxSub(n1, n2)
Case 2
Set n3 = objComplex.cxMul(n1, n2)
Case 3
Set n3 = objComplex.cxDiv(n1, n2)
Case 4
Set n3 = objComplex.cxExp(n1)
Case 5
Set n3 = objComplex.cxLb(n1)
Case 6
Set n3 = objComplex.cxLog(n1)
Case 7
Set n3 = objComplex.cxLn(n1)
Case 8
Set n3 = objComplex.cxPow(n1, 2)
Case 9
Set n3 = objComplex.cxSin(n1)
Case 10
Set n3 = objComplex.cxCos(n1)
Case 11
Set n3 = objComplex.cxTan(n1)
Case 12
Set n3 = objComplex.cxSinH(n1)
Case 13
Set n3 = objComplex.cxCosH(n1)
Case 14
Set n3 = objComplex.cxTanH(n1)
End Select
txtReal(2) = n3.Real
txtImag(2) = n3.Imaginary
txtForm(2) = n3.DispForm
End Sub
Private Sub Form_Load()
lstOperations.ListIndex = 0
End Sub
Private Sub lstOperations_DblClick()
cmdCalc.Value = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -