📄 wareinfo_treeview.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form wareinfo1
Caption = "wareinfo"
ClientHeight = 8430
ClientLeft = 60
ClientTop = 345
ClientWidth = 9540
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 8430
ScaleWidth = 9540
Begin VB.CommandButton Send
Caption = "发送"
Height = 495
Left = 7080
TabIndex = 8
Top = 2280
Width = 1095
End
Begin VB.CommandButton comnn
Caption = "确定"
Height = 375
Left = 6360
TabIndex = 7
Top = 480
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 5040
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.CommandButton cmb_ok
Caption = "确定"
Height = 495
Left = 840
TabIndex = 3
Top = 600
Width = 735
End
Begin VB.CommandButton cmdload
Caption = "Command1"
Height = 615
Left = 1920
TabIndex = 1
Top = 600
Width = 855
End
Begin MSComctlLib.TreeView tvwdb
Height = 6135
Left = 720
TabIndex = 0
Top = 2040
Width = 5655
_ExtentX = 9975
_ExtentY = 10821
_Version = 393217
Style = 7
ImageList = "imlSmallIcons"
Appearance = 1
End
Begin MSComctlLib.ImageList imlSmallIcons
Left = 0
Top = 0
_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 = "wareinfo_treeview.frx":0000
Key = "closed"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "wareinfo_treeview.frx":0172
Key = "cylinder"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "wareinfo_treeview.frx":02E4
Key = "leaf"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "wareinfo_treeview.frx":0456
Key = "open"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "wareinfo_treeview.frx":05C8
Key = "smlBook"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "wareinfo_treeview.frx":087A
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ProgressBar prgLoad
Height = 210
Left = 120
TabIndex = 2
Top = 0
Visible = 0 'False
Width = 9330
_ExtentX = 16457
_ExtentY = 370
_Version = 393216
Appearance = 1
End
Begin MSComctlLib.TabStrip Tab1
Height = 6855
Left = 600
TabIndex = 4
Top = 1440
Width = 6015
_ExtentX = 10610
_ExtentY = 12091
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 4
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "原料仓库"
Object.Tag = "1"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "半成品仓库"
Object.Tag = "2"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "成品仓库"
ImageVarType = 2
EndProperty
BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "产品"
ImageVarType = 2
EndProperty
EndProperty
End
Begin VB.Label Label1
Caption = "请输入过滤条件:"
Height = 255
Left = 3480
TabIndex = 6
Top = 480
Width = 1455
End
End
Attribute VB_Name = "wareinfo1"
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 ' 切换状态栏样式。
Dim str As String
Dim strtemp As String
Dim strtmp As String
' 打开记录集。
Const PUBLISHER = 1 ' 对于 EventFlag, 标记发行商 colmunheader 对象。
Const TITLE = 2 ' EventFlag, 在 ListView 中标记标题
Private Sub addwarename_Click()
End Sub
Private Sub cmb_ok_Click()
Dim tmp As String
'tmp = tvwdb.SelectedItem
If tvwdb.SelectedItem = "总仓库" Or IsNull(tvwdb.SelectedItem) Then
tmp = "l"
If MsgBox("请选择零件", vbRetryCancel, "选择错误") = vbNo Then
Unload Me
End If
End If
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 rsPublishers As New ADODB.Recordset
Dim mparentnode As node
Dim mtempnode As node
Dim irscurrent, irsold, i, j As Integer
Dim strcn As String
With tvwdb
.Sorted = True
Set mNode = .Nodes.Add()
.LabelEdit = False
.LineStyle = tvwRootLines
End With
With mNode ' Add first node.
.Text = "总仓库"
.Tag = "WARE"
.Image = "closed"
End With
' 创建 ADODB 记录集对象变量。
Select Case Tab1.SelectedItem
Case "原料仓库"
str = "SELECT wareinfo.ware_id,wareinfo.warename,wareinfo.drawing_no From wareinfo where wareinfo.ware_id like 'Cf%' "
Case "半成品仓库"
str = "SELECT wareinfo.ware_id,wareinfo.warename,wareinfo.drawing_no From wareinfo where wareinfo.ware_id like 'CH%' "
Case "成品仓库"
str = "SELECT wareinfo.ware_id,wareinfo.warename,wareinfo.drawing_no From wareinfo where wareinfo.ware_id like 'Ca%' "
Case "产品"
str = "SELECT wareinfo.ware_id,wareinfo.warename,wareinfo.drawing_no From wareinfo where wareinfo.ware_id like '%000' "
End Select
strcn = str & "ORDER BY wareinfo.ware_id"
With rsPublishers
.Open strcn, cn, adOpenStatic, adLockOptimistic
' 移动到记录尾部获得记录号,然后返回。
.MoveLast
.MoveFirst
' If Not rsPublishers.EOF Then
' irscurrent = CInt(Len(rsPublishers.Fields(1)))
' Else
' GoTo errer
' End If
'
End With
' 将进程栏设置为最大,并且使它可视。
With prgLoad
.Max = rsPublishers.RecordCount
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -