📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form1
BackColor = &H0000FF00&
Caption = "Form1"
ClientHeight = 5295
ClientLeft = 60
ClientTop = 450
ClientWidth = 8280
LinkTopic = "Form1"
ScaleHeight = 5295
ScaleWidth = 8280
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3600
TabIndex = 12
Top = 4200
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "结束"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 5280
TabIndex = 9
Top = 3960
Width = 1335
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form1.frx":0000
Height = 495
Left = 6240
TabIndex = 8
Top = 2040
Visible = 0 'False
Width = 1095
_ExtentX = 1931
_ExtentY = 873
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 855
Left = 6120
Top = 720
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 1508
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\VB\hjfg.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\VB\hjfg.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from hjfgsj"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
BackColor = &H00FF0000&
Caption = "数据表"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 6840
TabIndex = 7
Top = 3960
UseMaskColor = -1 'True
Width = 1335
End
Begin VB.CommandButton Command1
BackColor = &H00FF0000&
Caption = "计算结果"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 240
TabIndex = 6
Top = 3840
UseMaskColor = -1 'True
Width = 1575
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 5
Top = 4200
Width = 1575
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 4200
TabIndex = 4
Text = "1"
Top = 2040
Width = 975
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2160
TabIndex = 3
Text = "0"
Top = 2040
Width = 975
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2160
TabIndex = 0
Text = "0.2"
Top = 1200
Width = 1575
End
Begin VB.Label Label5
BackColor = &H0000FF00&
Caption = "信号与信息处理07 沈振汉 学号07020810021007"
Height = 375
Left = 2760
TabIndex = 14
Top = 4920
Width = 4215
End
Begin VB.Label Label4
BackColor = &H0000FF00&
Caption = "至"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3480
TabIndex = 13
Top = 2280
Width = 375
End
Begin VB.Label Label3
BackColor = &H0000FF00&
Caption = "极小值"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Index = 1
Left = 3720
TabIndex = 11
Top = 3840
Width = 855
End
Begin VB.Label Label3
BackColor = &H0000FF00&
Caption = "极小点"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Index = 0
Left = 2400
TabIndex = 10
Top = 3840
Width = 855
End
Begin VB.Label Label2
BackColor = &H0000FF00&
Caption = "初始区间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 360
TabIndex = 2
Top = 2280
Width = 1095
End
Begin VB.Label Label1
BackColor = &H0000FF00&
Caption = "长度L"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 1
Top = 1320
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim k As Integer
Dim l, ak, bk, vk, uk, fvk, fuk, x, jl, min As Single
Dim check
Private Sub Command1_Click()
l = Val(Text1.Text)
ak = Val(Text2.Text)
bk = Val(Text3.Text)
vk = ak + 0.382 * (bk - ak)
uk = ak + 0.618 * (bk - ak)
fvk = Exp(-vk) + vk ^ 2
fuk = Exp(-uk) + uk ^ 2
jl = (bk - ak)
Adodc1.Recordset.AddNew
Adodc1.Recordset!akd = Format(ak, "###0.0000")
Adodc1.Recordset!bkd = Format(bk, "###0.0000")
Adodc1.Recordset!vkd = Format(vk, "###0.0000")
Adodc1.Recordset!ukd = Format(uk, "###0.0000")
Adodc1.Recordset!fvkd = Format(fvk, "###0.0000")
Adodc1.Recordset!fukd = Format(fuk, "###0.0000")
Adodc1.Recordset.Update
DataGrid1.Refresh
JUDGE:
If jl > l Then
If fvk > fuk Then
ak = vk
bk = bk
vk = uk
uk = ak + 0.618 * (bk - ak)
fvk = Exp(-vk) + vk ^ 2
fuk = Exp(-uk) + uk ^ 2
jl = (bk - ak)
Adodc1.Recordset.AddNew
Adodc1.Recordset!akd = Format(ak, "###0.0000")
Adodc1.Recordset!bkd = Format(bk, "###0.0000")
Adodc1.Recordset!vkd = Format(vk, "###0.0000")
Adodc1.Recordset!ukd = Format(uk, "###0.0000")
Adodc1.Recordset!fvkd = Format(fvk, "###0.0000")
Adodc1.Recordset!fukd = Format(fuk, "###0.0000")
Adodc1.Recordset.Update
DataGrid1.Refresh
GoTo JUDGE
Else
ak = ak
bk = uk
uk = vk
vk = ak + 0.382 * (bk - ak)
fvk = Exp(-vk) + vk ^ 2
fuk = Exp(-uk) + uk ^ 2
jl = (bk - ak)
Adodc1.Recordset.AddNew
Adodc1.Recordset!akd = Format(ak, "###0.0000")
Adodc1.Recordset!bkd = Format(bk, "###0.0000")
Adodc1.Recordset!vkd = Format(vk, "###0.0000")
Adodc1.Recordset!ukd = Format(uk, "###0.0000")
Adodc1.Recordset!fvkd = Format(fvk, "###0.0000")
Adodc1.Recordset!fukd = Format(fuk, "###0.0000")
Adodc1.Recordset.Update
DataGrid1.Refresh
End If
GoTo JUDGE
Else
x = (ak + bk) / 2
min = Exp(-x) + x ^ 2
End If
Text4.Text = Format(x, "###0.0000")
Text5.Text = Format(min, "###0.0000")
End Sub
Private Sub Command2_Click()
Form2.Show
Form2.DataGrid1.Refresh
Form2.Left = 2500
Form2.Top = 2000
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -