📄 treeview.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmTreeview
Caption = "显示零件组成信息"
ClientHeight = 6870
ClientLeft = 165
ClientTop = 450
ClientWidth = 9150
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 6870
ScaleWidth = 9150
WindowState = 2 'Maximized
Begin VB.CommandButton Command6
Caption = "发送"
Height = 375
Left = 6960
TabIndex = 12
Top = 3000
Width = 1095
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 270
Left = 4680
TabIndex = 9
Top = 360
Width = 975
End
Begin VB.TextBox text1
Alignment = 2 'Center
Enabled = 0 'False
Height = 270
Left = 2040
TabIndex = 8
Top = 360
Width = 735
End
Begin VB.CommandButton command5
Caption = "刷新"
Height = 375
Left = 7200
TabIndex = 7
Top = 4080
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "编辑零件"
Height = 375
Left = 7200
TabIndex = 6
Top = 3360
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "删除零件"
Height = 375
Left = 7200
TabIndex = 5
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "增加同级零件"
Height = 375
Left = 7200
TabIndex = 4
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "增加子零件"
Height = 375
Left = 7200
TabIndex = 3
Top = 1200
Width = 1215
End
Begin MSComctlLib.TreeView tvwdb
Height = 6855
Left = 1080
TabIndex = 0
Top = 720
Width = 5655
_ExtentX = 9975
_ExtentY = 12091
_Version = 393217
LineStyle = 1
Style = 7
FullRowSelect = -1 'True
ImageList = "imlSmallIcons"
Appearance = 1
End
Begin VB.CommandButton cmdLoad
Caption = "加载"
Height = 270
Left = 3240
TabIndex = 1
Top = 4560
Width = 1050
End
Begin MSComctlLib.ProgressBar prgLoad
Height = 285
Left = 0
TabIndex = 2
Top = 0
Visible = 0 'False
Width = 9330
_ExtentX = 16457
_ExtentY = 503
_Version = 393216
Appearance = 1
End
Begin MSComctlLib.ImageList imlSmallIcons
Left = 240
Top = 2640
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 13
ImageHeight = 13
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":0000
Key = "closed"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":0172
Key = "cylinder"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":02E4
Key = "leaf"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":0456
Key = "open"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":05C8
Key = "smlBook"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":087A
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList imlIcons
Left = 960
Top = 2640
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "treeview.frx":0B2C
Key = "book"
EndProperty
EndProperty
End
Begin VB.Label Label2
Caption = "所属类型"
Height = 255
Left = 3480
TabIndex = 11
Top = 360
Width = 975
End
Begin VB.Label Label1
Caption = "包含数量"
Height = 255
Left = 960
TabIndex = 10
Top = 360
Width = 735
End
Begin VB.Menu ware_manage
Caption = "零件维护"
Begin VB.Menu ADD_ware
Caption = "增加子零件"
Shortcut = ^A
End
Begin VB.Menu ADD_XWARE
Caption = "增加同级零件"
End
Begin VB.Menu delete_ware
Caption = "删除零件"
End
Begin VB.Menu edit_ware
Caption = "编辑零件"
End
End
Begin VB.Menu node
Caption = "节点"
Begin VB.Menu EXPAND
Caption = "全部展开"
End
Begin VB.Menu COLOP
Caption = "全部收缩"
End
End
End
Attribute VB_Name = "frmTreeview"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mNode As node ' 模块级节点变量。
Private mItem As ListItem ' 模块级列表项变量。
Private EventFlag As Integer ' 标记所发生的事件。
Private mCurrentIndex As Integer ' 设置标志保证这个节点没有被单击。
Private mStatusBarStyle As Integer ' 切换状态栏样式。
'Private cn As ADODB.Connection ' 我们仅仅使用一个活动的连接。
Const PUBLISHER = 1 ' 对于 EventFlag, 标记发行商 colmunheader 对象。
Const TITLE = 2 ' EventFlag, 在 ListView 中标记标题
Dim rsPublishers As New ADODB.Recordset
Private Sub addwarename_Click()
End Sub
Private Sub add_ware_Click()
Dim f As New addware
Dim bflag As Boolean
If strleft = "" Then
If tvwdb.SelectedItem.Tag = "WARE" Then
strleft = "ware"
bflag = True
Else
bflag = False
End If
If bflag = False Then
If MsgBox("您未选择需要增加的零件", vbOKOnly, "操作错误") = vbOK Then Exit Sub
End If
End If
iflag = 1
f.Show
End Sub
Private Sub ADD_XWARE_Click()
Dim f As New addware
If strleft = "" Then
If MsgBox("您未选择需要增加的零件", vbOKOnly, "操作错误") = vbOK Then Exit Sub
End If
iflag = 0
strleft = Left(strleft, Len(strleft) - 8)
f.Show
End Sub
Private Sub cmdLoad_Click()
Dim intCounter As Integer ' Counter to set Progressbar.Value
Dim intIndex ' Variable for index of current node.
' 设置 ADODB 连接对象的连接字符串并且打开它。
Dim str As String
Dim mparentnode As node
Dim mtempnode As node
Dim irscurrent, irsold, i, j As Integer
str = "SELECT ware_product.ware_id, ware_product.ware_layer_id,calago.blong_to, ware_product.quantity,wareinfo.drawing_no,wareinfo.warename From ware_product,wareinfo,calago where ware_product.ware_id = wareinfo.ware_id and ware_product.blong_to = calago.id ORDER BY ware_product.ware_layer_id"
' 创建 ADODB 记录集对象变量。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -