📄 frmbp.frm
字号:
VScroll5.Visible = False
ElseIf Picture9.Height < Picture10.Height + Picture10.Top * 2 Then
'只出现垂直滚动条
VScroll5.Top = 0
VScroll5.Left = Picture9.Width - VScroll5.Width
VScroll5.Height = Picture9.Height
VScroll5.Max = Picture10.Height + 2 * Picture10.Top - Picture9.Height
VScroll5.Min = 0
HScroll5.Visible = False
VScroll5.Visible = True
Else
HScroll5.Visible = False
VScroll5.Visible = False
End If
HScroll5.SmallChange = 20
HScroll5.LargeChange = (HScroll5.Max - HScroll5.Min) / 10
HScroll5.Value = 0
VScroll5.SmallChange = 20
VScroll5.LargeChange = (VScroll5.Max - VScroll5.Min) / 10
VScroll5.Value = 0
End Sub
Private Sub hscroll5_Change() '水平滚动条变化
Picture10.Left = 0 - HScroll5.Value
End Sub
Private Sub text5Load() '调入文本框控件
Dim i, j As Integer
For i = 0 To JJ - 1 '调入水平表格中的各个文本框
For j = 1 To II '调入垂直表格中的各个文本框
Load Text5(i * II + j)
Text5(i * II + j).Visible = True
Text5(i * II + j).Left = Text5(0).Width * (j - 1)
Text5(i * II + j).Top = Text5(0).Height * i
Text5(i * II + j).Text = ""
Next j
Next i
End Sub
Private Sub vscroll5_Change() '垂直滚动条
Picture10.Top = 0 - VScroll5.Value
End Sub
Private Sub Pic11Redraw() '视窗图片重绘子程序
'设置表格载体图片控件的属性
Picture12.Width = 1 * Text1(0).Width + 50
Picture12.Height = JJ * Text1(0).Height + 50
'判断滚动条出现的不同情况
If Picture11.Width < Picture12.Width + Picture12.Left * 2 _
And Picture11.Height < Picture12.Height + Picture12.Top * 2 Then
'水平、垂直滚动条都出现
HScroll6.Left = 0
HScroll6.Top = Picture11.Height - HScroll6.Height
HScroll6.Width = Picture11.Width
HScroll6.Max = Picture12.Width + 2 * Picture12.Left - Picture11.Width
HScroll6.Min = 0
VScroll6.Top = 0
VScroll6.Left = Picture11.Width - VScroll6.Width
VScroll6.Height = Picture11.Height - HScroll6.Height
VScroll6.Max = Picture12.Height + 2 * Picture12.Top - Picture11.Height
VScroll6.Min = 0
HScroll6.Visible = True
VScroll6.Visible = True
ElseIf Picture11.Width < Picture12.Width + Picture12.Left * 2 Then
'只出现水平滚动条
HScroll6.Left = 0
HScroll6.Top = Picture11.Height - HScroll6.Height
HScroll6.Width = Picture11.Width
HScroll6.Max = Picture12.Width + 2 * Picture12.Left - Picture11.Width
HScroll6.Min = 0
HScroll6.Visible = True
VScroll6.Visible = False
ElseIf Picture11.Height < Picture12.Height + Picture12.Top * 2 Then
'只出现垂直滚动条
VScroll6.Top = 0
VScroll6.Left = Picture11.Width - VScroll6.Width
VScroll6.Height = Picture11.Height
VScroll6.Max = Picture12.Height + 2 * Picture12.Top - Picture11.Height
VScroll6.Min = 0
HScroll6.Visible = False
VScroll6.Visible = True
Else
HScroll6.Visible = False
VScroll6.Visible = False
End If
HScroll6.SmallChange = 20
HScroll6.LargeChange = (HScroll6.Max - HScroll6.Min) / 10
HScroll6.Value = 0
VScroll6.SmallChange = 20
VScroll6.LargeChange = (VScroll6.Max - VScroll6.Min) / 10
VScroll6.Value = 0
End Sub
Private Sub HScroll6_Change() '水平滚动条变化
Picture12.Left = 0 - HScroll6.Value
End Sub
Private Sub text9Load() '调入文本框控件
Dim i, j As Integer
For i = 0 To JJ - 1 '调入水平表格中的各个文本框
For j = 1 To 1 '调入垂直表格中的各个文本框
Load Text9(i * 1 + j)
Text9(i * 1 + j).Visible = True
Text9(i * 1 + j).Left = Text9(0).Width * (j - 1)
Text9(i * 1 + j).Top = Text9(0).Height * i
Text9(i * 1 + j).Text = ""
Next j
Next i
End Sub
Private Sub VScroll6_Change() '垂直滚动条
Picture12.Top = 0 - VScroll6.Value
End Sub
Private Sub Pic13Redraw() '视窗图片重绘子程序
'设置表格载体图片控件的属性
Picture14.Width = JJ * Text1(0).Width + 50
Picture14.Height = 1 * Text1(0).Height + 50
'判断滚动条出现的不同情况
If Picture13.Width < Picture14.Width + Picture14.Left * 2 _
And Picture13.Height < Picture14.Height + Picture14.Top * 2 Then
'水平、垂直滚动条都出现
HScroll7.Left = 0
HScroll7.Top = Picture13.Height - HScroll7.Height
HScroll7.Width = Picture13.Width
HScroll7.Max = Picture14.Width + 2 * Picture14.Left - Picture13.Width
HScroll7.Min = 0
VScroll7.Top = 0
VScroll7.Left = Picture13.Width - VScroll7.Width
VScroll7.Height = Picture13.Height - HScroll7.Height
VScroll7.Max = Picture14.Height + 2 * Picture14.Top - Picture13.Height
VScroll7.Min = 0
HScroll7.Visible = True
VScroll7.Visible = True
ElseIf Picture13.Width < Picture14.Width + Picture14.Left * 2 Then
'只出现水平滚动条
HScroll7.Left = 0
HScroll7.Top = Picture13.Height - HScroll7.Height
HScroll7.Width = Picture13.Width
HScroll7.Max = Picture14.Width + 2 * Picture14.Left - Picture13.Width
HScroll7.Min = 0
HScroll7.Visible = True
VScroll7.Visible = False
ElseIf Picture13.Height < Picture14.Height + Picture14.Top * 2 Then
'只出现垂直滚动条
VScroll7.Top = 0
VScroll7.Left = Picture13.Width - VScroll7.Width
VScroll7.Height = Picture13.Height
VScroll7.Max = Picture14.Height + 2 * Picture14.Top - Picture13.Height
VScroll7.Min = 0
HScroll7.Visible = False
VScroll7.Visible = True
Else
HScroll7.Visible = False
VScroll7.Visible = False
End If
HScroll7.SmallChange = 20
HScroll7.LargeChange = (HScroll7.Max - HScroll7.Min) / 10
HScroll7.Value = 0
VScroll7.SmallChange = 20
VScroll7.LargeChange = (VScroll7.Max - VScroll7.Min) / 10
VScroll7.Value = 0
End Sub
Private Sub HScroll7_Change() '水平滚动条变化
Picture14.Left = 0 - HScroll7.Value
End Sub
Private Sub Text10Load() '调入文本框控件
Dim i, j As Integer
For i = 0 To 1 - 1 '调入水平表格中的各个文本框
For j = 1 To KK '调入垂直表格中的各个文本框
Load Text10(i * 1 + j)
Text10(i * 1 + j).Visible = True
Text10(i * 1 + j).Left = Text10(0).Width * (j - 1)
Text10(i * 1 + j).Top = Text10(0).Height * i
Text10(i * 1 + j).Text = ""
Next j
Next i
End Sub
Private Sub vscroll7_Change() '垂直滚动条
Picture14.Top = 0 - VScroll7.Value
End Sub
Private Sub 保存权重_Click()
Dim i, j, k As Integer
CommonDialog1.DialogTitle = "另存为对话框"
CommonDialog1.InitDir = "c:\"
CommonDialog1.Filter = "文档文件(*.txt)|*.TXT|所有文件(*.*)|*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.DefaultExt = "*.txt"
CommonDialog1.Action = 2
Open CommonDialog1.FileName For Output As #2
If Err.Number = 0 Then
'Print #2, NN
'Print #2, II
'Print #2, JJ
'Print #2, KK
For j = 1 To JJ
For i = 1 To II
Print #2, V(j, i), '写入输入层到中间层的权值
Next i
Next j
For k = 1 To KK
For j = 1 To JJ
Print #2, W(k, j), '写入中间层到输出层的权值
Next j
Next k
For j = 1 To JJ
Print #2, R(j) '写入输入层到中间层的阀值
Next j
For k = 1 To KK
Print #2, Q(k) '写入中间层到输出层的阀值
Next k
Close #2
End If
End Sub
Private Sub 保存样本_Click()
Dim i, j, s, k As Integer
CommonDialog1.DialogTitle = "另存为对话框"
CommonDialog1.InitDir = "c:\"
CommonDialog1.Filter = "文档文件(*.txt)|*.TXT|所有文件(*.*)|*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.DefaultExt = "*.txt"
CommonDialog1.Action = 2
Open CommonDialog1.FileName For Output As #1
'Print #1, NN
'Print #1, II
'Print #1, JJ
'Print #1, KK
For i = 1 To NN
For j = 1 To II + KK
If j < II + 1 Then
Write #1, j;
'Print #1, ": ";
Write #1, z(i, j);
Else
Write #1, 0;
'Print #1, ": ";
Write #1, d(i, j - II)
End If
Next j
Next i
Close #1
End Sub
Private Sub 测试网络_Click()
Load FrmTest
FrmTest.Show
End Sub
Private Sub 打开权重_Click()
Dim i, j, k As Integer
'Static m As Integer
On Error GoTo note
CommonDialog1.DialogTitle = "打开权值文件"
CommonDialog1.InitDir = "C:\Documents and Settings\qjd1314\桌面\新建文件夹\周夏杰\可验证数据"
CommonDialog1.Filter = "文档文件(*.txt)|*.TXT|所有文件(*.*)|*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.Action = 1
Open CommonDialog1.FileName For Input As #1
If Err.Number = 0 Then
'Input #1, NN
'Input #1, II
'Input #1, JJ
'Input #1, KK
'If Mark2 = 1 And JJ = J1 Then
ReDim V(JJ, II)
ReDim W(KK, JJ)
ReDim R(JJ)
ReDim Q(KK)
For j = 1 To JJ
For i = 1 To II
Input #1, V(j, i) '写入输入层到中间层的权值
Next i
Next j
For k = 1 To KK
For j = 1 To JJ
Input #1, W(k, j) '写入中间层到输出层的权值
Next j
Next k
For j = 1 To JJ
Input #1, R(j) '写入输入层到中间层的阀值
Next j
For k = 1 To KK
Input #1, Q(k) '写入中间层到输出层的阀值
Next k
Close #1
End If
'If m = 0 Then
'Call text4Load
'Call text5Load
'Call text9Load
'Call Text10Load
'm = m + 1
'End If
'Call Pic7Redraw
'Call Pic9Redraw
'Call Pic11Redraw
'Call Pic13Redraw
Call Write_Key
Call Write_Weight
'Mark1 = 1
'End If
Exit Sub
note: MsgBox "权重文件格式错误或未选中文件,请重新导入" '标记
Close #1
End Sub
Private Sub 关闭_Click()
End
End Sub
Private Sub 退出_Click()
Unload Me
End Sub
Private Sub 打开样本_Click()
Dim s, c, i, j, k As Integer
On Error GoTo note
'Static l As Integer
CommonDialog1.DialogTitle = "打开样本文件"
CommonDialog1.InitDir = "C:\Documents and Settings\qjd1314\桌面\新建文件夹\周夏杰\可验证数据"
CommonDialog1.Filter = "文档文件(*.txt)|*.TXT|所有文件(*.*)|*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.Action = 1
Open CommonDialog1.FileName For Input As #1
If Err.Number = 0 Then
'Input #1, NN
'Input #1, II
'Input #1, JJ
'Input #1, KK
ReDim z(NN, II)
ReDim y(NN, JJ)
ReDim o(NN, KK)
ReDim d(NN, KK)
For i = 1 To NN
For j = 1 To II + KK
Input #1, s
If s = 0 Then
Input #1, d(i, j - II)
Else
Input #1, z(i, j)
End If
Next j
Next i
Close #1
End If
'Call Pic1Redraw
'If l = 0 Then
'Call Text1Load
'Call text3Load
'l = l + 1
'End If
'Call Pic5Redraw
Call Write_z_d
Exit Sub
note: MsgBox "样本文件格式错误或未选中文件,请重新导入"
Close #1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -