📄 frmwizarddefineattributes.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmWizardDefineAttributes
BorderStyle = 3 'Fixed Dialog
Caption = "Data Mining Wizard "
ClientHeight = 5190
ClientLeft = 45
ClientTop = 330
ClientWidth = 6870
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5190
ScaleWidth = 6870
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
WhatsThisHelp = -1 'True
Begin VB.Frame fraWelcome
Height = 4935
Index = 0
Left = 120
TabIndex = 0
Top = 120
Width = 6615
Begin VB.Frame fraSelectedTable
Caption = "&Your Selected Columns"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3255
Left = 3360
TabIndex = 9
Top = 240
Width = 3150
Begin MSComctlLib.TreeView tvwClassPredict
Height = 2895
Left = 75
TabIndex = 11
Top = 240
Width = 3000
_ExtentX = 5292
_ExtentY = 5106
_Version = 393217
LineStyle = 1
Sorted = -1 'True
Style = 6
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 6.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Begin VB.Frame fraAvailableTables
Caption = "&Select The Attribute Columns"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3255
Left = 120
TabIndex = 8
Top = 240
Width = 3150
Begin MSComctlLib.TreeView tvwAttributes
Height = 2895
Left = 75
TabIndex = 10
Top = 240
Width = 3000
_ExtentX = 5292
_ExtentY = 5106
_Version = 393217
Sorted = -1 'True
Style = 6
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 6.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
OLEDropMode = 1
End
End
Begin VB.Frame fraWelcome
Height = 615
Index = 2
Left = 120
TabIndex = 6
Top = 3480
Width = 6375
Begin VB.Label lblWelcome
Caption = "Select The Columns You Wish To Classify (both Numeric and Non Numeric)."
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 120
TabIndex = 7
Top = 240
Width = 6135
WordWrap = -1 'True
End
End
Begin VB.Frame FraNavigation
Height = 735
Left = 360
TabIndex = 1
Top = 4080
Width = 5895
Begin VB.CommandButton cmdCancel
Caption = "&Cancel"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 5
Top = 240
Width = 855
End
Begin VB.CommandButton cmdHelp
Caption = "&Help"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4560
TabIndex = 4
Top = 240
Width = 855
End
Begin VB.CommandButton cmdNext
Caption = "&Next >"
Enabled = 0 'False
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 3
Top = 240
Width = 855
End
Begin VB.CommandButton cmdBack
Caption = "< &Back"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 2
Top = 240
Width = 855
End
End
End
End
Attribute VB_Name = "frmWizardDefineAttributes"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private rstSchema As ADODB.Recordset
Private Sub cmdBack_Click()
frmWizardDefineClass.Show
Unload Me
End Sub
Private Sub cmdCancel_Click()
Unload Me
frmWizardWelcome.Show
End Sub
Private Sub cmdNext_Click()
frmWizardDecisionTrees.Show
Me.Hide
End Sub
Private Sub Form_Load()
On Error GoTo ErrorHandler
Dim strTable As String
Dim strClass As String
Dim strNode As String
Dim NodeObject As Node
'Get the schema for the fields in the database
Set rstSchema = DatabaseSchema.FieldSchema
rstSchema.MoveFirst
'The tree view control used for classification will use check boxes
tvwAttributes.Checkboxes = True
'Get the selected table's name
strTable = DataMiningServer.TableSelected
'Get the selected class
strClass = DataMiningServer.ClassSelected
If strTable <> "" Then
' The root node
Set NodeObject = tvwAttributes.Nodes.Add(, , "root", strTable)
NodeObject.Expanded = True
NodeObject.Sorted = True
NodeObject.Bold = True
NodeObject.Checked = True
NodeObject.Tag = "Selected Table"
Do While rstSchema.EOF = False
strNode = "[" & rstSchema!TABLE_NAME & "]"
'The selected class will not be available as an attribute
If (strTable = strNode) And (strClass <> rstSchema!COLUMN_NAME) Then
' This next node is a child of the root node (root).
Set NodeObject = tvwAttributes.Nodes.Add("root", tvwChild, , rstSchema!COLUMN_NAME)
NodeObject.Tag = rstSchema!COLUMN_NAME
'Expand the parent node
NodeObject.Parent.Expanded = True
End If
rstSchema.MoveNext
Loop
End If
Exit_ErrorHandler:
Exit Sub
ErrorHandler:
ErrorManager.ErrorHandler Err, _
"Form_Load.frmWizardDefineAttributes"
Resume Exit_ErrorHandler
End Sub
Private Sub tvwAttributes_NodeCheck(ByVal Node As MSComctlLib.Node)
On Error GoTo ErrorHandler
'This procedures runs when a Node is checked or unchecked in the Tree View
Dim strNode As String
Dim strTable As String
Dim lngIndex As Long
Dim fld As ADODB.Field
Dim rstSchema As ADODB.Recordset
Dim nodClass As Node
Dim lngCount As Long
Dim varAttributes() As Variant
Dim blnCheck As Boolean
'If the Root Node is selected, then exit
If Node = Node.Root Then Exit Sub
'If the parent node is not the root node, then exit
If Not Node.Parent = Node.Root Then Exit Sub
'If no field is selected then exit
If Node.Text = "" Then Exit Sub
lngIndex = Node.Index
'The name of the node selected
strNode = Node.Text
'The check state of the node
blnCheck = Node.Checked
If blnCheck = True Then
' The root node
If tvwClassPredict.Nodes.Count = 0 Then
Set nodClass = tvwClassPredict.Nodes.Add(, , "root", "")
nodClass.Tag = "Selected Attributes"
nodClass.Text = "Attributes"
End If
' This next node is a child of the root node (root).
Set nodClass = tvwClassPredict.Nodes.Add("root", tvwChild, , strNode)
nodClass.Tag = strNode
'Check the node
nodClass.Checked = blnCheck
'Expand the parent node
nodClass.Parent.Expanded = True
nodClass.Parent.Checked = True
Else
'The node deselected must be unchecked in the right tree
'view control. Uncheck all previously checked nodes
For Each Node In tvwClassPredict.Nodes
If (Node.Text = strNode) And (Node <> Node.Root) Then
lngIndex = Node.Index
Exit For
End If
Next
tvwClassPredict.Nodes.Remove lngIndex
End If
'Create a list of the attributes selected
For Each Node In tvwClassPredict.Nodes
If (Node <> Node.Root) Then
ReDim Preserve varAttributes(lngCount)
varAttributes(lngCount) = Node.Text
lngCount = lngCount + 1
End If
Next
'Store the list of attributes selected
DataMiningServer.AttributesSelected = varAttributes()
'Enable Or Disable the 'Next' Command Button
Call TreeView_Validate
Exit_ErrorHandler:
Exit Sub
ErrorHandler:
ErrorManager.ErrorHandler Err, _
"tvwAttributes_NodeCheck.frmWizardDefineAttributes"
Resume Exit_ErrorHandler
End Sub
Private Function TreeView_Validate() As Boolean
'Enables the 'Next' button if
'a table has been selected
Dim Node As Node
TreeView_Validate = False
cmdNext.Enabled = False
For Each Node In tvwClassPredict.Nodes
If Node <> Node.Root Then
cmdNext.Enabled = True
End If
Next
TreeView_Validate = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -