Afterload:
Dim cmb3 As WinForm.ComboBox = e.Form.Controls("ComboBox3")
cmb3.items.add("1")
cmb3.items.add("2")
cmb3.items.add("3")
cmb3.items.add("4")
Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cmb2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim i As Integer
For i = 0 To Tables("可能性").Rows.Count -1
cmb1.items.add(Tables("可能性").Rows(i)("等级"))
Next
For i = 0 To Tables("严重度").Rows.Count -1
cmb2.items.add(Tables("严重度").Rows(i)("等级"))
Next
Dim Lr As Integer
Dim Lc As Integer
Dim Sr As Integer
Dim Sc As Integer
Lr = Tables("可能性").Rows.Count
Lc = Tables("可能性").Cols.Count
Sr = Tables("严重度").Rows.Count
Sc = Tables("严重度").Cols.Count
Dim j As Integer
For i = 1 To Lc-1
Tables("风险矩阵")(0,i-1)=Tables("可能性").Cols(i).Caption
Next
For i = Lr-1 To 0 Step -1
For j = 1 To Lc-1
Tables("风险矩阵")(Lr-1-i+1,j-1)=Tables("可能性")(i,j)
Next
Next
For i = Lr-1 To 0 Step -1
Tables("风险矩阵")(Lr-1-i+1,0)="等级"&Tables("风险矩阵")(Lr-1-i+1,0)
Next
'
For i = 0 To Sr-1
Tables("风险矩阵")(Lr+1,i+Lc-1)="等级"&Tables("严重度").rows(i)("等级")
Next
For i = 0 To Sr-1
Tables("风险矩阵")(0,i+Lc-1)="等级"&Tables("严重度").rows(i)("等级")
Next
'
For j = 1 To Sc-1
Tables("风险矩阵")(Lr+j,Lc-2)=Tables("严重度").Cols(j).Caption
Next
'
For i = 0 To Sc-3
For j = 0 To Sr-1
'messagebox.show(j,i+2)
Tables("风险矩阵")(Lr+i+2,j+Lc-1)=Tables("严重度")(j,i+2)
Next
Next
Dim k As Integer
For i = 1 To Lr
For j = Lc-1 To Lc+4
For k = 0 To Tables("风险值").Rows.count -1
If Tables("风险矩阵")(i,0) = "等级" & cstr(Tables("风险值").Rows(k)("可能性")) And Tables("风险矩阵")(Lr+1,j) = "等级" & cstr(Tables("风险值").Rows(k)("严重度")) Then
Tables("风险矩阵")(i,j) = Tables("风险值").Rows(k)("风险值")
'Tables("中石油风险矩阵表")(i,j).Font= New Font("宋体",15,FontStyle.Regular)
'ForeColor = Color.DarkBlue
'messagebox.show(i,j)
End If
Next
Next
Next
'
For i = 0 To Tables("风险矩阵").Cols.Count-1
Tables("风险矩阵").Cols(i).CloseWindow
Next
Tables("风险矩阵").SetColVisibleWidth("第1列|80|第2列|260|第3列|260|第4列|260|第5列|260|第6列|260|第7列|260|第8列|260|第9列|260|第10列|260|第11列|260|第12列|260|第13列|260|第14列|260|第15列|260|第16列|260|第17列|260|第18列|260|第19列|260|第20列|260|第21列|260|第22列|260|第23列|260|第24列|260|第25列|260")
Tables("风险矩阵").AutoSizeRows
Tables("风险矩阵").Cols.Frozen =1
For Each dt As DataTable In DataTables
dt.Save()
Next