frmUse.frm
上传用户:yexiandon
上传日期:2022-07-12
资源大小:895k
文件大小:28k
源码类别:

百货/超市行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frmUse 
  5.    Caption         =   "配件领用信息"
  6.    ClientHeight    =   5940
  7.    ClientLeft      =   1860
  8.    ClientTop       =   5520
  9.    ClientWidth     =   15240
  10.    Icon            =   "frmUse.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5940
  14.    ScaleWidth      =   15240
  15.    WindowState     =   2  'Maximized
  16.    Begin MSComctlLib.ImageList ImageList1 
  17.       Left            =   13560
  18.       Top             =   1320
  19.       _ExtentX        =   1005
  20.       _ExtentY        =   1005
  21.       BackColor       =   -2147483643
  22.       ImageWidth      =   16
  23.       ImageHeight     =   16
  24.       MaskColor       =   12632256
  25.       _Version        =   393216
  26.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  27.          NumListImages   =   32
  28.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  29.             Picture         =   "frmUse.frx":08CA
  30.             Key             =   "A2"
  31.          EndProperty
  32.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  33.             Picture         =   "frmUse.frx":11A4
  34.             Key             =   "A1"
  35.          EndProperty
  36.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  37.             Picture         =   "frmUse.frx":1C6E
  38.             Key             =   "A0"
  39.          EndProperty
  40.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  41.             Picture         =   "frmUse.frx":2548
  42.             Key             =   ""
  43.          EndProperty
  44.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  45.             Picture         =   "frmUse.frx":30F2
  46.             Key             =   ""
  47.          EndProperty
  48.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  49.             Picture         =   "frmUse.frx":368C
  50.             Key             =   ""
  51.          EndProperty
  52.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  53.             Picture         =   "frmUse.frx":3C26
  54.             Key             =   ""
  55.          EndProperty
  56.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  57.             Picture         =   "frmUse.frx":41C0
  58.             Key             =   "gb"
  59.          EndProperty
  60.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  61.             Picture         =   "frmUse.frx":4D0A
  62.             Key             =   ""
  63.          EndProperty
  64.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.             Picture         =   "frmUse.frx":A92C
  66.             Key             =   ""
  67.          EndProperty
  68.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  69.             Picture         =   "frmUse.frx":AEC6
  70.             Key             =   ""
  71.          EndProperty
  72.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  73.             Picture         =   "frmUse.frx":B020
  74.             Key             =   ""
  75.          EndProperty
  76.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  77.             Picture         =   "frmUse.frx":B17A
  78.             Key             =   ""
  79.          EndProperty
  80.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  81.             Picture         =   "frmUse.frx":B2D4
  82.             Key             =   "f5"
  83.          EndProperty
  84.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  85.             Picture         =   "frmUse.frx":B42E
  86.             Key             =   ""
  87.          EndProperty
  88.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  89.             Picture         =   "frmUse.frx":B588
  90.             Key             =   "del"
  91.          EndProperty
  92.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  93.             Picture         =   "frmUse.frx":B6E2
  94.             Key             =   "cz"
  95.          EndProperty
  96.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  97.             Picture         =   "frmUse.frx":B83C
  98.             Key             =   ""
  99.          EndProperty
  100.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.             Picture         =   "frmUse.frx":B996
  102.             Key             =   "new"
  103.          EndProperty
  104.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.             Picture         =   "frmUse.frx":BF30
  106.             Key             =   "view"
  107.          EndProperty
  108.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.             Picture         =   "frmUse.frx":C4CA
  110.             Key             =   ""
  111.          EndProperty
  112.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.             Picture         =   "frmUse.frx":CA64
  114.             Key             =   "save"
  115.          EndProperty
  116.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.             Picture         =   "frmUse.frx":CFFE
  118.             Key             =   "cute"
  119.          EndProperty
  120.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.             Picture         =   "frmUse.frx":D598
  122.             Key             =   "copy"
  123.          EndProperty
  124.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  125.             Picture         =   "frmUse.frx":DB32
  126.             Key             =   "paste"
  127.          EndProperty
  128.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  129.             Picture         =   "frmUse.frx":E0CC
  130.             Key             =   "xg"
  131.          EndProperty
  132.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  133.             Picture         =   "frmUse.frx":E666
  134.             Key             =   "serch"
  135.          EndProperty
  136.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  137.             Picture         =   "frmUse.frx":EC00
  138.             Key             =   "info"
  139.          EndProperty
  140.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  141.             Picture         =   "frmUse.frx":F19A
  142.             Key             =   ""
  143.          EndProperty
  144.          BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  145.             Picture         =   "frmUse.frx":F734
  146.             Key             =   ""
  147.          EndProperty
  148.          BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  149.             Picture         =   "frmUse.frx":FCCE
  150.             Key             =   ""
  151.          EndProperty
  152.          BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  153.             Picture         =   "frmUse.frx":10268
  154.             Key             =   "exit"
  155.          EndProperty
  156.       EndProperty
  157.    End
  158.    Begin VB.PictureBox picSplitter 
  159.       BackColor       =   &H00808080&
  160.       BorderStyle     =   0  'None
  161.       FillColor       =   &H00808080&
  162.       Height          =   4920
  163.       Left            =   3120
  164.       ScaleHeight     =   2142.379
  165.       ScaleMode       =   0  'User
  166.       ScaleWidth      =   780
  167.       TabIndex        =   6
  168.       Top             =   960
  169.       Visible         =   0   'False
  170.       Width           =   72
  171.    End
  172.    Begin MSComctlLib.TreeView tvTreeView 
  173.       Height          =   4920
  174.       Left            =   0
  175.       TabIndex        =   5
  176.       Top             =   945
  177.       Width           =   3090
  178.       _ExtentX        =   5450
  179.       _ExtentY        =   8678
  180.       _Version        =   393217
  181.       HideSelection   =   0   'False
  182.       Indentation     =   529
  183.       LabelEdit       =   1
  184.       Style           =   7
  185.       HotTracking     =   -1  'True
  186.       SingleSel       =   -1  'True
  187.       ImageList       =   "ImageList1"
  188.       Appearance      =   1
  189.    End
  190.    Begin MSComctlLib.ListView lvListView 
  191.       Height          =   4920
  192.       Left            =   3135
  193.       TabIndex        =   4
  194.       Top             =   945
  195.       Width           =   13410
  196.       _ExtentX        =   23654
  197.       _ExtentY        =   8678
  198.       View            =   3
  199.       LabelEdit       =   1
  200.       LabelWrap       =   -1  'True
  201.       HideSelection   =   -1  'True
  202.       FullRowSelect   =   -1  'True
  203.       _Version        =   393217
  204.       Icons           =   "imlViewBIcon"
  205.       SmallIcons      =   "imlViewSIcon"
  206.       ColHdrIcons     =   "imlViewSIcon"
  207.       ForeColor       =   -2147483640
  208.       BackColor       =   -2147483643
  209.       BorderStyle     =   1
  210.       Appearance      =   1
  211.       NumItems        =   0
  212.    End
  213.    Begin VB.PictureBox picTitles 
  214.       Align           =   1  'Align Top
  215.       Appearance      =   0  'Flat
  216.       BorderStyle     =   0  'None
  217.       ForeColor       =   &H80000008&
  218.       Height          =   300
  219.       Left            =   0
  220.       ScaleHeight     =   300
  221.       ScaleWidth      =   15240
  222.       TabIndex        =   1
  223.       TabStop         =   0   'False
  224.       Top             =   585
  225.       Width           =   15240
  226.       Begin VB.Label lblTitle 
  227.          BorderStyle     =   1  'Fixed Single
  228.          Caption         =   " 列表视图:"
  229.          Height          =   270
  230.          Index           =   1
  231.          Left            =   3165
  232.          TabIndex        =   3
  233.          Tag             =   " 列表视图:"
  234.          Top             =   15
  235.          Width           =   11850
  236.       End
  237.       Begin VB.Label lblTitle 
  238.          BorderStyle     =   1  'Fixed Single
  239.          Caption         =   " 单据:"
  240.          Height          =   270
  241.          Index           =   0
  242.          Left            =   0
  243.          TabIndex        =   2
  244.          Tag             =   " 树形视图:"
  245.          Top             =   15
  246.          Width           =   3090
  247.       End
  248.    End
  249.    Begin MSComctlLib.Toolbar ToolBartb 
  250.       Align           =   1  'Align Top
  251.       Height          =   585
  252.       Left            =   0
  253.       TabIndex        =   0
  254.       Top             =   0
  255.       Width           =   15240
  256.       _ExtentX        =   26882
  257.       _ExtentY        =   1032
  258.       ButtonWidth     =   820
  259.       ButtonHeight    =   979
  260.       Appearance      =   1
  261.       Style           =   1
  262.       ImageList       =   "ImageList1"
  263.       _Version        =   393216
  264.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  265.          NumButtons      =   7
  266.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  267.             Caption         =   "新增"
  268.             Key             =   "news"
  269.             ImageKey        =   "new"
  270.          EndProperty
  271.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  272.             Caption         =   "修改"
  273.             Key             =   "modis"
  274.             ImageKey        =   "xg"
  275.          EndProperty
  276.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  277.             Caption         =   "删除"
  278.             Key             =   "dels"
  279.             ImageKey        =   "del"
  280.          EndProperty
  281.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  282.             Caption         =   "查看"
  283.             Key             =   "infos"
  284.             ImageKey        =   "info"
  285.          EndProperty
  286.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  287.             Caption         =   "图标"
  288.             Key             =   "view"
  289.             ImageKey        =   "view"
  290.             Style           =   5
  291.             BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628} 
  292.                NumButtonMenus  =   5
  293.                BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  294.                   Key             =   "dtb"
  295.                   Text            =   "大图标"
  296.                EndProperty
  297.                BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  298.                   Key             =   "xtb"
  299.                   Text            =   "小图标"
  300.                EndProperty
  301.                BeginProperty ButtonMenu3 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  302.                   Key             =   "lb"
  303.                   Text            =   "列表"
  304.                EndProperty
  305.                BeginProperty ButtonMenu4 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  306.                   Key             =   "xxzl"
  307.                   Text            =   "详细资料"
  308.                EndProperty
  309.                BeginProperty ButtonMenu5 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  310.                EndProperty
  311.             EndProperty
  312.          EndProperty
  313.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  314.             Style           =   3
  315.          EndProperty
  316.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  317.             Caption         =   "关闭"
  318.             Key             =   "exit"
  319.             ImageKey        =   "exit"
  320.          EndProperty
  321.       EndProperty
  322.    End
  323.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  324.       Left            =   13560
  325.       Top             =   2040
  326.       _ExtentX        =   847
  327.       _ExtentY        =   847
  328.       _Version        =   393216
  329.    End
  330.    Begin MSComctlLib.ImageList imlViewBIcon 
  331.       Left            =   600
  332.       Top             =   0
  333.       _ExtentX        =   1005
  334.       _ExtentY        =   1005
  335.       BackColor       =   -2147483643
  336.       ImageWidth      =   32
  337.       ImageHeight     =   32
  338.       MaskColor       =   12632256
  339.       _Version        =   393216
  340.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  341.          NumListImages   =   17
  342.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  343.             Picture         =   "frmUse.frx":10642
  344.             Key             =   "boy"
  345.          EndProperty
  346.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  347.             Picture         =   "frmUse.frx":10A94
  348.             Key             =   "girl"
  349.          EndProperty
  350.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  351.             Picture         =   "frmUse.frx":10EE6
  352.             Key             =   "bboy1"
  353.          EndProperty
  354.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  355.             Picture         =   "frmUse.frx":11F3A
  356.             Key             =   "bgirl"
  357.          EndProperty
  358.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  359.             Picture         =   "frmUse.frx":12F8E
  360.             Key             =   "group"
  361.          EndProperty
  362.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  363.             Picture         =   "frmUse.frx":15740
  364.             Key             =   "add"
  365.          EndProperty
  366.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  367.             Picture         =   "frmUse.frx":15B92
  368.             Key             =   "modify2"
  369.          EndProperty
  370.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  371.             Picture         =   "frmUse.frx":15FE4
  372.             Key             =   "modify"
  373.          EndProperty
  374.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  375.             Picture         =   "frmUse.frx":162FE
  376.             Key             =   "del"
  377.          EndProperty
  378.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  379.             Picture         =   "frmUse.frx":16458
  380.             Key             =   "info"
  381.          EndProperty
  382.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  383.             Picture         =   "frmUse.frx":169F2
  384.             Key             =   "info2"
  385.          EndProperty
  386.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  387.             Picture         =   "frmUse.frx":18CA4
  388.             Key             =   "search"
  389.          EndProperty
  390.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  391.             Picture         =   "frmUse.frx":1923E
  392.             Key             =   "warn"
  393.          EndProperty
  394.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  395.             Picture         =   "frmUse.frx":195D8
  396.             Key             =   "setting"
  397.          EndProperty
  398.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  399.             Picture         =   "frmUse.frx":198F2
  400.             Key             =   "lstView"
  401.          EndProperty
  402.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.             Picture         =   "frmUse.frx":19C0C
  404.             Key             =   "exit"
  405.          EndProperty
  406.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.             Picture         =   "frmUse.frx":1FEA6
  408.             Key             =   "bboy"
  409.          EndProperty
  410.       EndProperty
  411.    End
  412.    Begin MSComctlLib.ImageList imlViewSIcon 
  413.       Left            =   0
  414.       Top             =   0
  415.       _ExtentX        =   1005
  416.       _ExtentY        =   1005
  417.       BackColor       =   -2147483643
  418.       ImageWidth      =   16
  419.       ImageHeight     =   16
  420.       MaskColor       =   12632256
  421.       _Version        =   393216
  422.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  423.          NumListImages   =   7
  424.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  425.             Picture         =   "frmUse.frx":20AF8
  426.             Key             =   "group"
  427.          EndProperty
  428.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  429.             Picture         =   "frmUse.frx":20F4A
  430.             Key             =   "group2"
  431.          EndProperty
  432.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  433.             Picture         =   "frmUse.frx":236FC
  434.             Key             =   "boy"
  435.          EndProperty
  436.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  437.             Picture         =   "frmUse.frx":23B4E
  438.             Key             =   "girl"
  439.          EndProperty
  440.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  441.             Picture         =   "frmUse.frx":23FA0
  442.             Key             =   "sboy1"
  443.          EndProperty
  444.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  445.             Picture         =   "frmUse.frx":243F4
  446.             Key             =   "sgirl"
  447.          EndProperty
  448.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  449.             Picture         =   "frmUse.frx":24848
  450.             Key             =   "sboy"
  451.          EndProperty
  452.       EndProperty
  453.    End
  454.    Begin VB.Image imgSplitter 
  455.       Height          =   4785
  456.       Left            =   3120
  457.       MousePointer    =   9  'Size W E
  458.       Top             =   960
  459.       Width           =   150
  460.    End
  461. End
  462. Attribute VB_Name = "frmUse"
  463. Attribute VB_GlobalNameSpace = False
  464. Attribute VB_Creatable = False
  465. Attribute VB_PredeclaredId = True
  466. Attribute VB_Exposed = False
  467. '****************************************************************************
  468. '人人为我,我为人人
  469. '枕善居收藏整理
  470. '发布日期:2008/01/21
  471. '描    述:汽车维修管理系统SQL2000版
  472. '网    站:http://www.Mndsoft.com/  (VB6源码博客)
  473. '网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
  474. 'e-mail  :Mndsoft@163.com
  475. 'e-mail  :Mndsoft@126.com
  476. 'OICQ    :88382850
  477. '          如果您有新的好的代码别忘记给枕善居哦!
  478. '****************************************************************************
  479. Dim mbMoving As Boolean
  480. Const sglSplitLimit = 500
  481. Dim strName As String
  482. Private OK As Boolean               '确定用户按了OK还是CANCEL按钮
  483. Private mvarViewType As gxcViewType '显示类型,即表示当前是添加、查看、修改
  484. Const allSQL = "select ID,pID,pNum,pPrice,pDemo from SubStore"
  485. Public Sub AddClientToLvw(ByVal objClient As Recordset, _
  486.                           ByRef lvw As ListView, _
  487.                           ByVal IsOverWrite As Boolean)
  488.   Dim itm As ListItem
  489.   Dim sIcon As String
  490.   Dim bIcon As String
  491.     sIcon = "sboy"
  492.     bIcon = "bboy"
  493.   If IsOverWrite Then
  494.     Set itm = lvw.SelectedItem
  495.     If itm Is Nothing Then Exit Sub
  496.   Else
  497.     Set itm = lvw.ListItems.Add(, "A" & objClient("ID"), , bIcon, sIcon)
  498.   End If
  499.   With objClient  '这里要与InitClientListview相对应
  500.     itm.SmallIcon = sIcon
  501.     itm.Icon = bIcon
  502.     itm.Text = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pName")
  503.     itm.SubItems(1) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pType")
  504.     itm.SubItems(2) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pUnit")
  505.     itm.SubItems(3) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pNum")
  506.     itm.SubItems(4) = GetValueByID("PeiJian", "ID", .Fields(1).Value, "pDemo")
  507.     itm.SubItems(5) = Val(.Fields(2).Value)
  508.     itm.SubItems(6) = Val(.Fields(3).Value)
  509.     itm.SubItems(7) = Val(.Fields(2).Value) * Val(.Fields(3).Value)
  510.     itm.SubItems(8) = .Fields(4).Value
  511.   End With
  512.   Set itm = Nothing
  513. End Sub
  514. '按照“客户”设置ListView的显示样式
  515. Public Sub InitClientListview(ByRef lvw As ListView)
  516.   With lvw
  517.     .ColumnHeaders.Clear
  518.     '加入四个列首
  519.     .ColumnHeaders.Add , , "名称", 1500
  520.     .ColumnHeaders.Add , , "规格", 1200
  521.     .ColumnHeaders.Add , , "单位", 800
  522.     .ColumnHeaders.Add , , "报件数量", 900
  523.     .ColumnHeaders.Add , , "报件时间", 1900
  524.     .ColumnHeaders.Add , , "采购数量", 900
  525.     .ColumnHeaders.Add , , "单价", 1000
  526.     .ColumnHeaders.Add , , "金额", 900
  527.     .ColumnHeaders.Add , , "备注", 2300
  528.   End With
  529. End Sub
  530. '将职员显示到ListView中
  531. Public Sub ClientsToListview(ByVal objClients As Recordset, ByRef lvw As ListView)
  532.   Dim i As Long
  533.   
  534.   If lvw.ColumnHeaders.Count = 0 Then InitClientListview lvw
  535.   lvw.ListItems.Clear '清除当前的列表内容
  536.   
  537.   For i = 1 To objClients.RecordCount
  538.     AddClientToLvw objClients.DataSource, lvw, False
  539.     objClients.MoveNext
  540.   Next i
  541. End Sub
  542. ' 显示全部客户到列表控件
  543. Public Sub ListAllClients(ByRef lvw As ListView)
  544.   Dim rstClients As New Recordset
  545.   Set rstClients = g_Conn.Execute(allSQL)
  546.   ClientsToListview rstClients, lvw
  547.   Set rstClients = Nothing
  548. End Sub
  549. Private Sub cmdAddNews_Click()
  550. frm_Use.mvarViewType = vtadd
  551. frm_Use.Show vbModal
  552. If frm_Use.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"))
  553. End Sub
  554. Private Sub cmdDeletes_Click()
  555. If MsgBox("真的要删除“" & tvTreeView.SelectedItem.Text & "”吗?", vbQuestion + vbYesNo + _
  556.         vbDefaultButton2) = vbNo Then Exit Sub
  557. On Error Resume Next
  558. g_Conn.BeginTrans
  559. g_Conn.Execute ("Delete from Store where ID=" & GetID(tvTreeView.SelectedItem.Key))
  560. g_Conn.Execute ("Delete from SubStore where sID=" & GetID(tvTreeView.SelectedItem.Key))
  561. If Err.Number = 0 Then g_Conn.CommitTrans Else g_Conn.RollbackTrans: MsgBox Err.Description
  562. tvTreeView.Nodes.Remove tvTreeView.SelectedItem.Index
  563. End Sub
  564. Private Sub cmdModifys_Click()
  565. If GetID(tvTreeView.SelectedItem.Key) = 0 Then Exit Sub
  566. frm_Use.mvarID = tvTreeView.SelectedItem.Key
  567. frm_Use.mvarViewType = vtModify
  568. frm_Use.Show vbModal
  569. 'If frm_Use.OK = True Then Refrs
  570. End Sub
  571. Private Sub cmdClose_Click()
  572.     Unload Me
  573. End Sub
  574. Private Sub Form_Load()
  575.     InitClientListview lvListView '初始化列表
  576.     TypeToTreeview tvTreeView
  577. End Sub
  578. Private Sub Form_Resize()
  579.     On Error Resume Next
  580.     If Me.Width < 3000 Then Me.Width = 3000
  581.     SizeControls imgSplitter.Left
  582. End Sub
  583. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  584.     With imgSplitter
  585.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  586.     End With
  587.     picSplitter.Visible = True
  588.     mbMoving = True
  589. End Sub
  590. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  591.     Dim sglPos As Single
  592.     
  593.     If mbMoving Then
  594.         sglPos = x + imgSplitter.Left
  595.         If sglPos < sglSplitLimit Then
  596.             picSplitter.Left = sglSplitLimit
  597.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  598.             picSplitter.Left = Me.Width - sglSplitLimit
  599.         Else
  600.             picSplitter.Left = sglPos
  601.         End If
  602.     End If
  603. End Sub
  604. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  605.     SizeControls picSplitter.Left
  606.     picSplitter.Visible = False
  607.     mbMoving = False
  608. End Sub
  609. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  610.     If Source = imgSplitter Then
  611.         SizeControls x
  612.     End If
  613. End Sub
  614. Sub SizeControls(x As Single)
  615.     On Error Resume Next
  616.     
  617.     '设置 Width 属性
  618.     If x < 1500 Then x = 1500
  619.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  620.     tvTreeView.Width = x
  621.     imgSplitter.Left = x
  622.     lvListView.Left = x + 40
  623.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  624.     lblTitle(0).Width = tvTreeView.Width
  625.     lblTitle(1).Left = lvListView.Left + 20
  626.     lblTitle(1).Width = lvListView.Width - 40
  627.     '设置 Top 属性
  628.   
  629.     If ToolBartb.Visible Then
  630.         tvTreeView.Top = ToolBartb.Height + picTitles.Height
  631.     Else
  632.         tvTreeView.Top = picTitles.Height
  633.     End If
  634.     lvListView.Top = tvTreeView.Top
  635.     
  636.     '设置 height 属性
  637.         tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  638.     lvListView.Height = tvTreeView.Height
  639.     imgSplitter.Top = tvTreeView.Top
  640.     imgSplitter.Height = tvTreeView.Height
  641. End Sub
  642. Public Sub TypeToTreeview(ByRef tvw As TreeView)
  643.   Dim i As Long
  644.   Dim Nd As Node
  645.   Dim Rs As Recordset
  646.   Set Nd = tvw.Nodes.Add(, , "A0", "所有单据", "A0")
  647.   
  648.   Nd.Expanded = True
  649.   Nd.Selected = True
  650. Set Rs = g_Conn.Execute("select A.ID,c.clkName,car.carNo from Store A left join Clerk c on c.clkID=A.cID left join Client car on car.ID=A.carID Where A.type=-1")
  651.   For i = 1 To Rs.RecordCount
  652.     Set Nd = tvw.Nodes.Add("A0", tvwChild, "A" & Rs(0), Rs(1) & "(" & Rs(2) & ")", "A1")
  653.     Nd.Expanded = True
  654.  Rs.MoveNext
  655.   Next i
  656. End Sub
  657. Public Sub AddTypeToTvw(ByRef tvw As TreeView, objID As Recordset)
  658.   On Error Resume Next
  659.      tvw.Nodes.Add "A0", tvwChild, "A" & objID.Fields(0), objID.Fields(1) & "(" & objID.Fields(2) & ")", "A1"
  660. End Sub
  661. Private Sub ToolBartb_ButtonClick(ByVal Button As MSComctlLib.Button)
  662. Select Case Button.Key
  663.     Case "exit"
  664.         cmdClose_Click
  665.     Case "news"
  666.         If g_QX(6) Then cmdAddNews_Click Else MsgBox qMSG
  667.     Case "modis"
  668.         If g_QX(6) Then cmdModifys_Click Else MsgBox qMSG
  669.     Case "dels"
  670.         If g_QX(6) Then cmdDeletes_Click Else MsgBox qMSG
  671.     Case "infos"
  672.         tvTreeView_DblClick
  673.     Case "view"
  674.         If lvListView.View = lvwIcon Then
  675.             lvListView.View = lvwSmallIcon
  676.         ElseIf lvListView.View = lvwSmallIcon Then
  677.             lvListView.View = lvwList
  678.         ElseIf lvListView.View = lvwList Then
  679.             lvListView.View = lvwReport
  680.         ElseIf lvListView.View = lvwReport Then
  681.             lvListView.View = lvwIcon
  682.         End If
  683. End Select
  684. End Sub
  685. Private Sub ToolBartb_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
  686. Select Case ButtonMenu.Key
  687.     Case "dtb"
  688.         lvListView.View = lvwIcon
  689.     Case "xtb"
  690.         lvListView.View = lvwSmallIcon
  691.     Case "lb"
  692.         lvListView.View = lvwList
  693.     Case "xxzl"
  694.         lvListView.View = lvwReport
  695. End Select
  696. End Sub
  697. Private Sub tvTreeView_DblClick()
  698. frm_Use.mvarID = tvTreeView.SelectedItem.Key
  699. frm_Use.mvarViewType = vtinfo
  700. frm_Use.Show vbModal
  701. End Sub
  702. Private Sub tvTreeView_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  703. Dim menuRight As Menu
  704. Set menuRight = frmMain.mnuCg
  705. If Button = 2 Then PopupMenu menuRight
  706. End Sub
  707. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  708. Dim Rst As New ADODB.Recordset
  709.     Set Rst = g_Conn.Execute(allSQL & " where sID=" & GetID(Me.tvTreeView.SelectedItem.Key))
  710.     ClientsToListview Rst, lvListView
  711. End Sub