📄 formresult.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form FormResult
BorderStyle = 3 'Fixed Dialog
Caption = "Dest"
ClientHeight = 6615
ClientLeft = 555
ClientTop = 1875
ClientWidth = 8610
LinkTopic = "Form2"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6615
ScaleWidth = 8610
ShowInTaskbar = 0 'False
Begin MSComDlg.CommonDialog dlgCommonDialog
Left = 1080
Top = 6000
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Save
Caption = "结果导出"
Enabled = 0 'False
Height = 372
Left = 6000
TabIndex = 5
Top = 6120
Width = 1092
End
Begin VB.CommandButton Check
Caption = "冲突检测"
Height = 372
Left = 3120
TabIndex = 4
Top = 6120
Width = 1092
End
Begin VB.CommandButton Cancel
Caption = "退出"
Height = 372
Left = 7440
TabIndex = 3
Top = 6120
Width = 1092
End
Begin VB.CommandButton Combine
Caption = "方案组合"
Enabled = 0 'False
Height = 372
Left = 4560
TabIndex = 2
Top = 6120
Width = 1092
End
Begin VB.Frame Frame1
Caption = "推理结果"
Height = 5655
Left = 120
TabIndex = 0
Top = 240
Width = 8415
Begin VB.TextBox Text1
Height = 300
Left = 840
TabIndex = 6
Text = "Text1"
Top = 5280
Visible = 0 'False
Width = 2055
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 4935
Left = 120
TabIndex = 1
Top = 360
Width = 8175
_ExtentX = 14420
_ExtentY = 8705
_Version = 393216
Rows = 100
Cols = 100
AllowUserResizing= 1
End
End
End
Attribute VB_Name = "FormResult"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cancel_Click()
Unload Me
End Sub
Private Sub Check_Click()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer
Dim checked As Boolean
For i = 1 To Rmax
For j = 1 To Cmax
Me.MSFlexGrid1.row = i
Me.MSFlexGrid1.Col = j
If Me.MSFlexGrid1.CellBackColor <> Me.MSFlexGrid1.BackColor Then
Me.MSFlexGrid1.CellBackColor = Me.MSFlexGrid1.BackColor
End If
Next
Next
For i = 0 To clk
For j = 0 To 99
checked = False
If resultqueue(i, j, 4) <> "" Then
For m = i To clk
For k = 0 To 100
If resultqueue(m, k, 4) <> "" And resultqueue(m, k, 5) = "" And (i <> m Or j <> k) Then
If resultqueue(i, j, 0) = resultqueue(m, k, 0) And resultqueue(i, j, 1) = resultqueue(m, k, 1) Then
resultqueue(i, j, 5) = "checked"
resultqueue(m, k, 5) = "checked"
Me.MSFlexGrid1.row = j + 1
Me.MSFlexGrid1.Col = i * 5 + 1
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = i * 5 + 2
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = i * 5 + 3
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = i * 5 + 4
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.row = k + 1
Me.MSFlexGrid1.Col = m * 5 + 1
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = m * 5 + 2
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = m * 5 + 3
Me.MSFlexGrid1.CellBackColor = &H80000018
Me.MSFlexGrid1.Col = m * 5 + 4
Me.MSFlexGrid1.CellBackColor = &H80000018
checked = True
End If
End If
Next
Next
End If
If checked = True Then
MsgBox "检测到公共变量"
Me.Check.Caption = "继续"
Exit Sub
End If
Next
Next
Me.Check.Caption = "冲突检测"
MsgBox "冲突检测完毕!"
Me.Save.Enabled = True
End Sub
'Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
'Me.MSFlexGrid1.Text = Me.MSFlexGrid1.Text + Chr(KeyAscii)
'Me.MSFlexGrid1.Refresh
'End Sub
Private Sub Save_Click()
Dim sFile As String
Dim i As Integer
Dim j As Integer
Dim str As String
Me.MSFlexGrid1.Refresh
With dlgCommonDialog
.DialogTitle = "保存为"
str = Left(currentXml, Len(currentXml) - 4) + "结论.txt"
.Filename = str
.CancelError = False
.InitDir = Prj_Location
'ToDo: set the flags and attributes of the common dialog control
.Filter = "Result Files (*.rst)|*.rst|All Files (*.*)|*.*"
.ShowSave
If Len(.Filename) = 0 Then
Exit Sub
End If
sFile = .Filename
End With
Open sFile For Output As #1
For j = 1 To Cmax Step 5
For i = 0 To Rmax
Write #1, Me.MSFlexGrid1.TextMatrix(i, j) + Me.MSFlexGrid1.TextMatrix(i, j + 1) + Me.MSFlexGrid1.TextMatrix(i, j + 2) + Me.MSFlexGrid1.TextMatrix(i, j + 3)
Next
Next
MsgBox "结果导出成功!"
Close #1
End Sub
Private Sub MSFlexGrid1_DblClick()
Dim c As Integer, r As Integer
With MSFlexGrid1
c = .Col: r = .row
Text1.Left = .Left + .ColPos(c) + 30
Text1.Top = .Top + .RowPos(r)
Text1.Width = .ColWidth(c)
Text1.Height = .RowHeight(r)
Text1 = .Text
Text1.Visible = True
Text1.SetFocus
End With
End Sub
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
Call MSFlexGrid1_DblClick
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then
Text1.Visible = False
MSFlexGrid1.SetFocus
Exit Sub
End If
If KeyAscii = vbKeyReturn Then
MSFlexGrid1.Text = Text1.Text
Text1.Visible = False
MSFlexGrid1.SetFocus
End If
End Sub
Private Sub Text1_LostFocus()
Text1.Visible = False
MSFlexGrid1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -