📄 frmmatrix.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form frmMatrix
BorderStyle = 1 'Fixed Single
Caption = "AHP"
ClientHeight = 4800
ClientLeft = 48
ClientTop = 336
ClientWidth = 6132
LinkTopic = "Form2"
LockControls = -1 'True
MinButton = 0 'False
ScaleHeight = 4800
ScaleWidth = 6132
StartUpPosition = 2 'CenterScreen
Begin VB.ComboBox Combo1
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 2520
TabIndex = 7
Text = "Combo1"
Top = 1200
Visible = 0 'False
Width = 1455
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000001&
BorderStyle = 0 'None
FillStyle = 0 'Solid
FontTransparent = 0 'False
ForeColor = &H80000008&
Height = 735
Left = 2040
ScaleHeight = 732
ScaleWidth = 4092
TabIndex = 4
Top = 0
Width = 4095
End
Begin VB.CommandButton CommandCheck
Caption = "一致性检验"
Height = 495
Left = 1920
TabIndex = 3
Top = 4200
Width = 1575
End
Begin VB.CommandButton CommandCacu
Caption = "计算特征向量"
Height = 495
Left = 120
TabIndex = 2
Top = 4200
Width = 1575
End
Begin VB.CommandButton CommandCon
Caption = "继续"
Height = 495
Left = 3720
TabIndex = 1
Top = 4200
Width = 1575
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 3135
Left = 120
TabIndex = 0
ToolTipText = "双击文本框选择然后回车"
Top = 840
Width = 5895
_ExtentX = 10393
_ExtentY = 5525
_Version = 393216
TextStyle = 3
FocusRect = 2
FillStyle = 1
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 7.8
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "层次分析"
BeginProperty Font
Name = "华文新魏"
Size = 14.4
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 375
Left = 120
TabIndex = 5
Top = 240
Width = 1335
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H80000001&
BeginProperty Font
Name = "宋体"
Size = 9.6
Charset = 134
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 0
TabIndex = 6
Top = 0
Width = 2055
End
End
Attribute VB_Name = "frmMatrix"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CommandCacu_Click() '计算特征向量
If (LoadData) Then
Call GetRoot
CommandCheck.Enabled = True
End If
End Sub
Private Sub CommandCheck_Click()
If (LoadData) Then '读入数据成功,则进行一致性检验
Call Consistency_Check
CommandCon.Enabled = True
End If
End Sub
Private Sub CommandCon_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 9
Combo1.AddItem i
Next i
Me.CommandCon.Enabled = False
Me.CommandCheck.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
Private Sub MSFlexGrid1_DblClick()
Dim c, r As Integer
With MSFlexGrid1
c = .Col
r = .row
Combo1.Left = .Left + .ColPos(c) + 30
Combo1.Top = .Top + .RowPos(r) + 30
Combo1.Width = .ColWidth(c)
Combo1.Text = .Text
Combo1.Visible = True
Combo1.SetFocus
End With
End Sub
'Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer) '输入排错
'On Error Resume Next
'Me.MSFlexGrid1.Text = Me.MSFlexGrid1.Text + Chr(KeyAscii)
'If (ValidateText(Me.MSFlexGrid1.Text)) Then
' Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Col, Me.MSFlexGrid1.row) = FormatNumber(1 / Me.MSFlexGrid1.Text, 4, vbTrue, vbTrue, vbFalse)
' Me.MSFlexGrid1.Refresh
'Else
' MsgBox "输入错误,请输入数字1-9", vbExclamation, "Dest3.0"
' Me.MSFlexGrid1.Text = ""
'End If
'End Sub
Private Function ValidateText(ByVal Text As String) As Boolean '矩阵数据应输入1-9整数
Dim yr As Double
If (IsNumeric(Text)) Then
yr = CDbl(Text)
If yr = 1 Then
ValidateText = True
ElseIf yr = 2 Then
ValidateText = True
ElseIf yr = 3 Then
ValidateText = True
ElseIf yr = 4 Then
ValidateText = True
ElseIf yr = 5 Then
ValidateText = True
ElseIf yr = 6 Then
ValidateText = True
ElseIf yr = 7 Then
ValidateText = True
ElseIf yr = 8 Then
ValidateText = True
ElseIf yr = 9 Then
ValidateText = True
Else
ValidateText = False
End If
Else
ValidateText = False
End If
End Function
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
Call MSFlexGrid1_DblClick
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then
Combo1.Visible = False
MSFlexGrid1.SetFocus
Exit Sub
End If
If KeyAscii = vbKeyReturn Then
MSFlexGrid1.Text = Combo1.Text
Combo1.Visible = False
If (ValidateText(Me.MSFlexGrid1.Text)) Then
Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Col, Me.MSFlexGrid1.row) = FormatNumber(1 / Me.MSFlexGrid1.Text, 4, vbTrue, vbTrue, vbFalse)
Else
MsgBox "输入错误,请输入数字1-9", vbExclamation, "Dest3.0"
Me.MSFlexGrid1.Text = ""
End If
MSFlexGrid1.SetFocus
End If
End Sub
Private Sub Combo1_LostFocus()
Combo1.Visible = False
MSFlexGrid1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -