frmCg.frm
上传用户:yexiandon
上传日期:2022-07-12
资源大小:895k
文件大小:28k
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form frmCg
- Caption = "配件采购信息"
- ClientHeight = 5940
- ClientLeft = 1860
- ClientTop = 5520
- ClientWidth = 15240
- Icon = "frmCg.frx":0000
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 5940
- ScaleWidth = 15240
- WindowState = 2 'Maximized
- Begin MSComctlLib.ImageList ImageList1
- Left = 13560
- Top = 1320
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 32
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":08CA
- Key = "A2"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":11A4
- Key = "A1"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":1C6E
- Key = "A0"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":2548
- Key = ""
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":30F2
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":368C
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":3C26
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":41C0
- Key = "gb"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":4D0A
- Key = ""
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":A92C
- Key = ""
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":AEC6
- Key = ""
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B020
- Key = ""
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B17A
- Key = ""
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B2D4
- Key = "f5"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B42E
- Key = ""
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B588
- Key = "del"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B6E2
- Key = "cz"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B83C
- Key = ""
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":B996
- Key = "new"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":BF30
- Key = "view"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":C4CA
- Key = ""
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":CA64
- Key = "save"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":CFFE
- Key = "cute"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":D598
- Key = "copy"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":DB32
- Key = "paste"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":E0CC
- Key = "xg"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":E666
- Key = "serch"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":EC00
- Key = "info"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":F19A
- Key = ""
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":F734
- Key = ""
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":FCCE
- Key = ""
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":10268
- Key = "exit"
- EndProperty
- EndProperty
- End
- Begin VB.PictureBox picSplitter
- BackColor = &H00808080&
- BorderStyle = 0 'None
- FillColor = &H00808080&
- Height = 4920
- Left = 3120
- ScaleHeight = 2142.379
- ScaleMode = 0 'User
- ScaleWidth = 780
- TabIndex = 6
- Top = 960
- Visible = 0 'False
- Width = 72
- End
- Begin MSComctlLib.TreeView tvTreeView
- Height = 4920
- Left = 0
- TabIndex = 5
- Top = 945
- Width = 3090
- _ExtentX = 5450
- _ExtentY = 8678
- _Version = 393217
- HideSelection = 0 'False
- Indentation = 529
- LabelEdit = 1
- Style = 7
- HotTracking = -1 'True
- SingleSel = -1 'True
- ImageList = "ImageList1"
- Appearance = 1
- End
- Begin MSComctlLib.ListView lvListView
- Height = 4920
- Left = 3135
- TabIndex = 4
- Top = 945
- Width = 13410
- _ExtentX = 23654
- _ExtentY = 8678
- View = 3
- LabelEdit = 1
- LabelWrap = -1 'True
- HideSelection = -1 'True
- FullRowSelect = -1 'True
- _Version = 393217
- Icons = "imlViewBIcon"
- SmallIcons = "imlViewSIcon"
- ColHdrIcons = "imlViewSIcon"
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 0
- End
- Begin VB.PictureBox picTitles
- Align = 1 'Align Top
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 300
- Left = 0
- ScaleHeight = 300
- ScaleWidth = 15240
- TabIndex = 1
- TabStop = 0 'False
- Top = 585
- Width = 15240
- Begin VB.Label lblTitle
- BorderStyle = 1 'Fixed Single
- Caption = " 列表视图:"
- Height = 270
- Index = 1
- Left = 3165
- TabIndex = 3
- Tag = " 列表视图:"
- Top = 15
- Width = 11850
- End
- Begin VB.Label lblTitle
- BorderStyle = 1 'Fixed Single
- Caption = " 单据:"
- Height = 270
- Index = 0
- Left = 0
- TabIndex = 2
- Tag = " 树形视图:"
- Top = 15
- Width = 3090
- End
- End
- Begin MSComctlLib.Toolbar ToolBartb
- Align = 1 'Align Top
- Height = 585
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 15240
- _ExtentX = 26882
- _ExtentY = 1032
- ButtonWidth = 820
- ButtonHeight = 926
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 9
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "新增"
- Key = "news"
- ImageKey = "new"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "modis"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "dels"
- ImageKey = "del"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查看"
- Key = "infos"
- ImageKey = "info"
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "图标"
- Key = "view"
- ImageKey = "view"
- Style = 5
- BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
- NumButtonMenus = 5
- BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "dtb"
- Text = "大图标"
- EndProperty
- BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "xtb"
- Text = "小图标"
- EndProperty
- BeginProperty ButtonMenu3 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "lb"
- Text = "列表"
- EndProperty
- BeginProperty ButtonMenu4 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "xxzl"
- Text = "详细资料"
- EndProperty
- BeginProperty ButtonMenu5 {66833FEE-8583-11D1-B16A-00C0F0283628}
- EndProperty
- EndProperty
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查找"
- Key = "Find"
- ImageKey = "cz"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "关闭"
- Key = "exit"
- ImageKey = "exit"
- EndProperty
- EndProperty
- End
- Begin MSComDlg.CommonDialog dlgCommonDialog
- Left = 13560
- Top = 2040
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin MSComctlLib.ImageList imlViewBIcon
- Left = 600
- Top = 0
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 17
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":10642
- Key = "boy"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":10A94
- Key = "girl"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":10EE6
- Key = "bboy1"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":11F3A
- Key = "bgirl"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":12F8E
- Key = "group"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":15740
- Key = "add"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":15B92
- Key = "modify2"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":15FE4
- Key = "modify"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":162FE
- Key = "del"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":16458
- Key = "info"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":169F2
- Key = "info2"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":18CA4
- Key = "search"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":1923E
- Key = "warn"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":195D8
- Key = "setting"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":198F2
- Key = "lstView"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":19C0C
- Key = "exit"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":1FEA6
- Key = "bboy"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ImageList imlViewSIcon
- Left = 0
- Top = 0
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 7
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":20AF8
- Key = "group"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":20F4A
- Key = "group2"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":236FC
- Key = "boy"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":23B4E
- Key = "girl"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":23FA0
- Key = "sboy1"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":243F4
- Key = "sgirl"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmCg.frx":24848
- Key = "sboy"
- EndProperty
- EndProperty
- End
- Begin VB.Image imgSplitter
- Height = 4785
- Left = 3120
- MousePointer = 9 'Size W E
- Top = 960
- Width = 150
- End
- End
- Attribute VB_Name = "frmCg"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '****************************************************************************
- '人人为我,我为人人
- '枕善居收藏整理
- '发布日期:2008/01/21
- '描 述:汽车维修管理系统SQL2000版
- '网 站:http://www.Mndsoft.com/ (VB6源码博客)
- '网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
- 'e-mail :Mndsoft@163.com
- 'e-mail :Mndsoft@126.com
- 'OICQ :88382850
- ' 如果您有新的好的代码别忘记给枕善居哦!
- '****************************************************************************
- Dim mbMoving As Boolean
- Const sglSplitLimit = 500
- Dim strName As String
- Private OK As Boolean '确定用户按了OK还是CANCEL按钮
- Private mvarViewType As gxcViewType '显示类型,即表示当前是添加、查看、修改
- Const allSQL = "select ID,pID,pNum,pPrice,pDemo from SubStore"
- Public Sub AddClientToLvw(ByVal objClient As Recordset, _
- ByRef lvw As ListView, _
- ByVal IsOverWrite As Boolean)
- Dim itm As ListItem
- Dim sIcon As String
- Dim bIcon As String
- sIcon = "sboy"
- bIcon = "bboy"
- If IsOverWrite Then
- Set itm = lvw.SelectedItem
- If itm Is Nothing Then Exit Sub
- Else
- Set itm = lvw.ListItems.Add(, "A" & objClient("ID"), , bIcon, sIcon)
- End If
- With objClient '这里要与InitClientListview相对应
- itm.SmallIcon = sIcon
- itm.Icon = bIcon
- itm.Text = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pName")
- itm.SubItems(1) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pType")
- itm.SubItems(2) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pUnit")
- itm.SubItems(3) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pNum")
- itm.SubItems(4) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pDemo")
- itm.SubItems(5) = Val(.Fields(2).Value)
- itm.SubItems(6) = Val(.Fields(3).Value)
- itm.SubItems(7) = Val(.Fields(2).Value) * Val(.Fields(3).Value)
- itm.SubItems(8) = .Fields(4).Value
- End With
- Set itm = Nothing
- End Sub
- '按照“客户”设置ListView的显示样式
- Public Sub InitClientListview(ByRef lvw As ListView)
- With lvw
- .ColumnHeaders.Clear
- '加入四个列首
- .ColumnHeaders.Add , , "名称", 1500
- .ColumnHeaders.Add , , "规格", 1200
- .ColumnHeaders.Add , , "单位", 800
- .ColumnHeaders.Add , , "报件数量", 900
- .ColumnHeaders.Add , , "报件时间", 1900
- .ColumnHeaders.Add , , "采购数量", 900
- .ColumnHeaders.Add , , "单价", 1000
- .ColumnHeaders.Add , , "金额", 900
- .ColumnHeaders.Add , , "备注", 2300
- End With
- End Sub
- '将职员显示到ListView中
- Public Sub ClientsToListview(ByVal objClients As Recordset, ByRef lvw As ListView)
- Dim i As Long
-
- If lvw.ColumnHeaders.Count = 0 Then InitClientListview lvw
- lvw.ListItems.Clear '清除当前的列表内容
-
- For i = 1 To objClients.RecordCount
- AddClientToLvw objClients.DataSource, lvw, False
- objClients.MoveNext
- Next i
- End Sub
- ' 显示全部客户到列表控件
- Public Sub ListAllClients(ByRef lvw As ListView)
- Dim rstClients As New Recordset
- Set rstClients = g_Conn.Execute(allSQL)
- ClientsToListview rstClients, lvw
- Set rstClients = Nothing
- End Sub
- Private Sub cmdAddNews_Click()
- frm_CFM.mvarViewType = vtadd
- frm_CFM.Show vbModal
- If frm_CFM.OK = True Then AddTypeToTvw tvTreeView, g_Conn.Execute("select A.ID,c.clkName,A.Fdate from Store A left join Clerk c on c.clkID=A.cID Where A.ID=" & MaxID("Store", "ID"))
- End Sub
- Private Sub cmdDeletes_Click()
- If MsgBox("真的要删除“" & tvTreeView.SelectedItem.Text & "”吗?", vbQuestion + vbYesNo + _
- vbDefaultButton2) = vbNo Then Exit Sub
- On Error Resume Next
- g_Conn.BeginTrans
- g_Conn.Execute ("Delete from Store where ID=" & GetID(tvTreeView.SelectedItem.Key))
- g_Conn.Execute ("Delete from SubStore where sID=" & GetID(tvTreeView.SelectedItem.Key))
- If Err.Number = 0 Then g_Conn.CommitTrans Else g_Conn.RollbackTrans: MsgBox Err.Description
- tvTreeView.Nodes.Remove tvTreeView.SelectedItem.Index
- End Sub
- Private Sub cmdModifys_Click()
- If GetID(tvTreeView.SelectedItem.Key) = 0 Then Exit Sub
- frm_CFM.mvarID = tvTreeView.SelectedItem.Key
- frm_CFM.mvarViewType = vtModify
- frm_CFM.Show vbModal
- 'If frm_CFM.OK = True Then Refrs
- End Sub
- Private Sub cmdClose_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- InitClientListview lvListView '初始化列表
- TypeToTreeview tvTreeView
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- If Me.Width < 3000 Then Me.Width = 3000
- SizeControls imgSplitter.Left
- End Sub
- Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- With imgSplitter
- picSplitter.Move .Left, .Top, .Width 2, .Height - 20
- End With
- picSplitter.Visible = True
- mbMoving = True
- End Sub
- Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
- Dim sglPos As Single
-
- If mbMoving Then
- sglPos = x + imgSplitter.Left
- If sglPos < sglSplitLimit Then
- picSplitter.Left = sglSplitLimit
- ElseIf sglPos > Me.Width - sglSplitLimit Then
- picSplitter.Left = Me.Width - sglSplitLimit
- Else
- picSplitter.Left = sglPos
- End If
- End If
- End Sub
- Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
- SizeControls picSplitter.Left
- picSplitter.Visible = False
- mbMoving = False
- End Sub
- Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
- If Source = imgSplitter Then
- SizeControls x
- End If
- End Sub
- Sub SizeControls(x As Single)
- On Error Resume Next
-
- '设置 Width 属性
- If x < 1500 Then x = 1500
- If x > (Me.Width - 1500) Then x = Me.Width - 1500
- tvTreeView.Width = x
- imgSplitter.Left = x
- lvListView.Left = x + 40
- lvListView.Width = Me.Width - (tvTreeView.Width + 140)
- lblTitle(0).Width = tvTreeView.Width
- lblTitle(1).Left = lvListView.Left + 20
- lblTitle(1).Width = lvListView.Width - 40
- '设置 Top 属性
-
- If ToolBartb.Visible Then
- tvTreeView.Top = ToolBartb.Height + picTitles.Height
- Else
- tvTreeView.Top = picTitles.Height
- End If
- lvListView.Top = tvTreeView.Top
-
- '设置 height 属性
- tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
- lvListView.Height = tvTreeView.Height
- imgSplitter.Top = tvTreeView.Top
- imgSplitter.Height = tvTreeView.Height
- End Sub
- Public Sub TypeToTreeview(ByRef tvw As TreeView)
- Dim i As Long
- Dim Nd As Node
- Dim Rs As Recordset
- Set Nd = tvw.Nodes.Add(, , "A0", "所有单据", "A0")
-
- Nd.Expanded = True
- Nd.Selected = True
- Set Rs = g_Conn.Execute("select A.ID,c.clkName,A.Fdate from Store A left join Clerk c on c.clkID=A.cID where A.Type=1")
- For i = 1 To Rs.RecordCount
- Set Nd = tvw.Nodes.Add("A0", tvwChild, "A" & Rs(0), Rs(1) & "(" & Rs(2) & ")", "A1")
- Nd.Expanded = True
- Rs.MoveNext
- Next i
- End Sub
- Public Sub AddTypeToTvw(ByRef tvw As TreeView, objID As Recordset)
- On Error Resume Next
- tvw.Nodes.Add "A0", tvwChild, "A" & objID.Fields(0), objID.Fields(1) & "(" & objID.Fields(2) & ")", "A1"
- End Sub
- Private Sub ToolBartb_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "exit"
- cmdClose_Click
- Case "news"
- If g_QX(5) Then cmdAddNews_Click Else MsgBox qMSG
- Case "modis"
- If g_QX(5) Then cmdModifys_Click Else MsgBox qMSG
- Case "dels"
- If g_QX(5) Then cmdDeletes_Click Else MsgBox qMSG
- Case "infos"
- tvTreeView_DblClick
- Case "view"
- If lvListView.View = lvwIcon Then
- lvListView.View = lvwSmallIcon
- ElseIf lvListView.View = lvwSmallIcon Then
- lvListView.View = lvwList
- ElseIf lvListView.View = lvwList Then
- lvListView.View = lvwReport
- ElseIf lvListView.View = lvwReport Then
- lvListView.View = lvwIcon
- End If
- End Select
- End Sub
- Private Sub ToolBartb_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
- Select Case ButtonMenu.Key
- Case "dtb"
- lvListView.View = lvwIcon
- Case "xtb"
- lvListView.View = lvwSmallIcon
- Case "lb"
- lvListView.View = lvwList
- Case "xxzl"
- lvListView.View = lvwReport
- End Select
- End Sub
- Private Sub tvTreeView_DblClick()
- frm_CFM.mvarID = tvTreeView.SelectedItem.Key
- frm_CFM.mvarViewType = vtinfo
- frm_CFM.Show vbModal
- End Sub
- Private Sub tvTreeView_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- Dim menuRight As Menu
- Set menuRight = frmMain.mnuCg
- If Button = 2 Then PopupMenu menuRight
- End Sub
- Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
- Dim Rst As New ADODB.Recordset
- Set Rst = g_Conn.Execute(allSQL & " where sID=" & GetID(Me.tvTreeView.SelectedItem.Key))
- ClientsToListview Rst, lvListView
- End Sub