frmPJ.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 frmPJ 
  5.    Caption         =   "配件基本信息"
  6.    ClientHeight    =   5940
  7.    ClientLeft      =   1860
  8.    ClientTop       =   5520
  9.    ClientWidth     =   15240
  10.    Icon            =   "frmPJ.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         =   "frmPJ.frx":08CA
  30.             Key             =   "A2"
  31.          EndProperty
  32.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  33.             Picture         =   "frmPJ.frx":11A4
  34.             Key             =   "A1"
  35.          EndProperty
  36.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  37.             Picture         =   "frmPJ.frx":1C6E
  38.             Key             =   "A0"
  39.          EndProperty
  40.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  41.             Picture         =   "frmPJ.frx":2548
  42.             Key             =   ""
  43.          EndProperty
  44.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  45.             Picture         =   "frmPJ.frx":30F2
  46.             Key             =   ""
  47.          EndProperty
  48.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  49.             Picture         =   "frmPJ.frx":368C
  50.             Key             =   ""
  51.          EndProperty
  52.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  53.             Picture         =   "frmPJ.frx":3C26
  54.             Key             =   ""
  55.          EndProperty
  56.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  57.             Picture         =   "frmPJ.frx":41C0
  58.             Key             =   "gb"
  59.          EndProperty
  60.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  61.             Picture         =   "frmPJ.frx":4D0A
  62.             Key             =   ""
  63.          EndProperty
  64.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.             Picture         =   "frmPJ.frx":A92C
  66.             Key             =   ""
  67.          EndProperty
  68.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  69.             Picture         =   "frmPJ.frx":AEC6
  70.             Key             =   ""
  71.          EndProperty
  72.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  73.             Picture         =   "frmPJ.frx":B020
  74.             Key             =   ""
  75.          EndProperty
  76.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  77.             Picture         =   "frmPJ.frx":B17A
  78.             Key             =   ""
  79.          EndProperty
  80.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  81.             Picture         =   "frmPJ.frx":B2D4
  82.             Key             =   "f5"
  83.          EndProperty
  84.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  85.             Picture         =   "frmPJ.frx":B42E
  86.             Key             =   ""
  87.          EndProperty
  88.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  89.             Picture         =   "frmPJ.frx":B588
  90.             Key             =   "del"
  91.          EndProperty
  92.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  93.             Picture         =   "frmPJ.frx":B6E2
  94.             Key             =   "cz"
  95.          EndProperty
  96.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  97.             Picture         =   "frmPJ.frx":B83C
  98.             Key             =   ""
  99.          EndProperty
  100.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.             Picture         =   "frmPJ.frx":B996
  102.             Key             =   "new"
  103.          EndProperty
  104.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.             Picture         =   "frmPJ.frx":BF30
  106.             Key             =   "view"
  107.          EndProperty
  108.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.             Picture         =   "frmPJ.frx":C4CA
  110.             Key             =   ""
  111.          EndProperty
  112.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.             Picture         =   "frmPJ.frx":CA64
  114.             Key             =   "save"
  115.          EndProperty
  116.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.             Picture         =   "frmPJ.frx":CFFE
  118.             Key             =   "cute"
  119.          EndProperty
  120.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.             Picture         =   "frmPJ.frx":D598
  122.             Key             =   "copy"
  123.          EndProperty
  124.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  125.             Picture         =   "frmPJ.frx":DB32
  126.             Key             =   "paste"
  127.          EndProperty
  128.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  129.             Picture         =   "frmPJ.frx":E0CC
  130.             Key             =   "xg"
  131.          EndProperty
  132.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  133.             Picture         =   "frmPJ.frx":E666
  134.             Key             =   "serch"
  135.          EndProperty
  136.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  137.             Picture         =   "frmPJ.frx":EC00
  138.             Key             =   "info"
  139.          EndProperty
  140.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  141.             Picture         =   "frmPJ.frx":F19A
  142.             Key             =   ""
  143.          EndProperty
  144.          BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  145.             Picture         =   "frmPJ.frx":F734
  146.             Key             =   ""
  147.          EndProperty
  148.          BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  149.             Picture         =   "frmPJ.frx":FCCE
  150.             Key             =   ""
  151.          EndProperty
  152.          BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  153.             Picture         =   "frmPJ.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            =   2040
  164.       ScaleHeight     =   2142.379
  165.       ScaleMode       =   0  'User
  166.       ScaleWidth      =   780
  167.       TabIndex        =   6
  168.       Top             =   945
  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           =   2010
  178.       _ExtentX        =   3545
  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            =   2055
  193.       TabIndex        =   4
  194.       Top             =   945
  195.       Width           =   14490
  196.       _ExtentX        =   25559
  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            =   2085
  232.          TabIndex        =   3
  233.          Tag             =   " 列表视图:"
  234.          Top             =   15
  235.          Width           =   12930
  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             =   12
  246.          Width           =   2016
  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    =   926
  260.       Appearance      =   1
  261.       Style           =   1
  262.       ImageList       =   "ImageList1"
  263.       _Version        =   393216
  264.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  265.          NumButtons      =   12
  266.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  267.             Caption         =   "新增"
  268.             Key             =   "new"
  269.             ImageKey        =   "new"
  270.          EndProperty
  271.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  272.             Caption         =   "修改"
  273.             Key             =   "modi"
  274.             ImageKey        =   "xg"
  275.          EndProperty
  276.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  277.             Caption         =   "删除"
  278.             Key             =   "del"
  279.             ImageKey        =   "del"
  280.          EndProperty
  281.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  282.             Caption         =   "查看"
  283.             Key             =   "info"
  284.             ImageKey        =   "info"
  285.          EndProperty
  286.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  287.             Style           =   3
  288.          EndProperty
  289.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  290.             Caption         =   "新增"
  291.             Key             =   "news"
  292.             ImageKey        =   "new"
  293.          EndProperty
  294.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  295.             Caption         =   "修改"
  296.             Key             =   "modis"
  297.             ImageKey        =   "xg"
  298.          EndProperty
  299.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  300.             Caption         =   "删除"
  301.             Key             =   "dels"
  302.             ImageKey        =   "del"
  303.          EndProperty
  304.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  305.             Caption         =   "查看"
  306.             Key             =   "infos"
  307.             ImageKey        =   "info"
  308.          EndProperty
  309.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  310.             Caption         =   "图标"
  311.             Key             =   "view"
  312.             ImageKey        =   "view"
  313.             Style           =   5
  314.             BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628} 
  315.                NumButtonMenus  =   5
  316.                BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  317.                   Key             =   "dtb"
  318.                   Text            =   "大图标"
  319.                EndProperty
  320.                BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  321.                   Key             =   "xtb"
  322.                   Text            =   "小图标"
  323.                EndProperty
  324.                BeginProperty ButtonMenu3 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  325.                   Key             =   "lb"
  326.                   Text            =   "列表"
  327.                EndProperty
  328.                BeginProperty ButtonMenu4 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  329.                   Key             =   "xxzl"
  330.                   Text            =   "详细资料"
  331.                EndProperty
  332.                BeginProperty ButtonMenu5 {66833FEE-8583-11D1-B16A-00C0F0283628} 
  333.                EndProperty
  334.             EndProperty
  335.          EndProperty
  336.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  337.             Style           =   3
  338.          EndProperty
  339.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  340.             Caption         =   "关闭"
  341.             Key             =   "exit"
  342.             ImageKey        =   "exit"
  343.          EndProperty
  344.       EndProperty
  345.    End
  346.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  347.       Left            =   13560
  348.       Top             =   2040
  349.       _ExtentX        =   847
  350.       _ExtentY        =   847
  351.       _Version        =   393216
  352.    End
  353.    Begin MSComctlLib.ImageList imlViewBIcon 
  354.       Left            =   600
  355.       Top             =   0
  356.       _ExtentX        =   1005
  357.       _ExtentY        =   1005
  358.       BackColor       =   -2147483643
  359.       ImageWidth      =   32
  360.       ImageHeight     =   32
  361.       MaskColor       =   12632256
  362.       _Version        =   393216
  363.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  364.          NumListImages   =   17
  365.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  366.             Picture         =   "frmPJ.frx":10642
  367.             Key             =   "boy"
  368.          EndProperty
  369.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  370.             Picture         =   "frmPJ.frx":10A94
  371.             Key             =   "girl"
  372.          EndProperty
  373.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  374.             Picture         =   "frmPJ.frx":10EE6
  375.             Key             =   "bboy1"
  376.          EndProperty
  377.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  378.             Picture         =   "frmPJ.frx":11F3A
  379.             Key             =   "bgirl"
  380.          EndProperty
  381.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  382.             Picture         =   "frmPJ.frx":12F8E
  383.             Key             =   "group"
  384.          EndProperty
  385.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  386.             Picture         =   "frmPJ.frx":15740
  387.             Key             =   "add"
  388.          EndProperty
  389.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  390.             Picture         =   "frmPJ.frx":15B92
  391.             Key             =   "modify2"
  392.          EndProperty
  393.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  394.             Picture         =   "frmPJ.frx":15FE4
  395.             Key             =   "modify"
  396.          EndProperty
  397.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  398.             Picture         =   "frmPJ.frx":162FE
  399.             Key             =   "del"
  400.          EndProperty
  401.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  402.             Picture         =   "frmPJ.frx":16458
  403.             Key             =   "info"
  404.          EndProperty
  405.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  406.             Picture         =   "frmPJ.frx":169F2
  407.             Key             =   "info2"
  408.          EndProperty
  409.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  410.             Picture         =   "frmPJ.frx":18CA4
  411.             Key             =   "search"
  412.          EndProperty
  413.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  414.             Picture         =   "frmPJ.frx":1923E
  415.             Key             =   "warn"
  416.          EndProperty
  417.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  418.             Picture         =   "frmPJ.frx":195D8
  419.             Key             =   "setting"
  420.          EndProperty
  421.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  422.             Picture         =   "frmPJ.frx":198F2
  423.             Key             =   "lstView"
  424.          EndProperty
  425.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  426.             Picture         =   "frmPJ.frx":19C0C
  427.             Key             =   "exit"
  428.          EndProperty
  429.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  430.             Picture         =   "frmPJ.frx":1FEA6
  431.             Key             =   "bboy"
  432.          EndProperty
  433.       EndProperty
  434.    End
  435.    Begin MSComctlLib.ImageList imlViewSIcon 
  436.       Left            =   0
  437.       Top             =   0
  438.       _ExtentX        =   1005
  439.       _ExtentY        =   1005
  440.       BackColor       =   -2147483643
  441.       ImageWidth      =   16
  442.       ImageHeight     =   16
  443.       MaskColor       =   12632256
  444.       _Version        =   393216
  445.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  446.          NumListImages   =   7
  447.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  448.             Picture         =   "frmPJ.frx":20AF8
  449.             Key             =   "group"
  450.          EndProperty
  451.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  452.             Picture         =   "frmPJ.frx":20F4A
  453.             Key             =   "group2"
  454.          EndProperty
  455.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  456.             Picture         =   "frmPJ.frx":236FC
  457.             Key             =   "boy"
  458.          EndProperty
  459.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  460.             Picture         =   "frmPJ.frx":23B4E
  461.             Key             =   "girl"
  462.          EndProperty
  463.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  464.             Picture         =   "frmPJ.frx":23FA0
  465.             Key             =   "sboy1"
  466.          EndProperty
  467.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  468.             Picture         =   "frmPJ.frx":243F4
  469.             Key             =   "sgirl"
  470.          EndProperty
  471.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  472.             Picture         =   "frmPJ.frx":24848
  473.             Key             =   "sboy"
  474.          EndProperty
  475.       EndProperty
  476.    End
  477.    Begin VB.Image imgSplitter 
  478.       Height          =   4785
  479.       Left            =   1965
  480.       MousePointer    =   9  'Size W E
  481.       Top             =   945
  482.       Width           =   150
  483.    End
  484. End
  485. Attribute VB_Name = "frmPJ"
  486. Attribute VB_GlobalNameSpace = False
  487. Attribute VB_Creatable = False
  488. Attribute VB_PredeclaredId = True
  489. Attribute VB_Exposed = False
  490. '****************************************************************************
  491. '人人为我,我为人人
  492. '枕善居收藏整理
  493. '发布日期:2008/01/21
  494. '描    述:汽车维修管理系统SQL2000版
  495. '网    站:http://www.Mndsoft.com/  (VB6源码博客)
  496. '网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
  497. 'e-mail  :Mndsoft@163.com
  498. 'e-mail  :Mndsoft@126.com
  499. 'OICQ    :88382850
  500. '          如果您有新的好的代码别忘记给枕善居哦!
  501. '****************************************************************************
  502. Dim mbMoving As Boolean
  503. Const sglSplitLimit = 500
  504. Dim strName As String
  505. Private OK As Boolean               '确定用户按了OK还是CANCEL按钮
  506. Private mvarViewType As gxcViewType '显示类型,即表示当前是添加、查看、修改
  507. Const allSQL = "select ID,pName,pType,pCID,pUnit,pDemo,pNum from PeiJian"
  508. Public Sub AddClientToLvw(ByVal objClient As Recordset, _
  509.                           ByRef lvw As ListView, _
  510.                           ByVal IsOverWrite As Boolean)
  511.   Dim itm As ListItem
  512.   Dim sIcon As String
  513.   Dim bIcon As String
  514.   'If objClient("clkSex") = Male Then
  515.     sIcon = "sboy"
  516.     bIcon = "bboy"
  517.   'Else
  518.   '  sIcon = "sgirl"
  519.   '  bIcon = "bgirl"
  520.   'End If
  521.   
  522.   '如果是更新(即覆盖),则使用当前选种的元素
  523.   If IsOverWrite Then
  524.     Set itm = lvw.SelectedItem
  525.     If itm Is Nothing Then Exit Sub
  526.   Else
  527.     Set itm = lvw.ListItems.Add(, "A" & objClient("ID"), , bIcon, sIcon)
  528.   End If
  529.   With objClient  '这里要与InitClientListview相对应
  530.     itm.SmallIcon = sIcon
  531.     itm.Icon = bIcon
  532.     itm.Text = .Fields(1).Value
  533.     itm.SubItems(1) = .Fields(2).Value
  534.     itm.SubItems(2) = GetValueByID("Client", "ID", .Fields(3).Value, "carNo")
  535.     itm.SubItems(3) = .Fields(4).Value
  536.     itm.SubItems(4) = .Fields(5).Value
  537.     itm.SubItems(5) = .Fields(6).Value
  538.   End With
  539.   Set itm = Nothing
  540. End Sub
  541. '按照“客户”设置ListView的显示样式
  542. Public Sub InitClientListview(ByRef lvw As ListView)
  543.   With lvw
  544.     .ColumnHeaders.Clear
  545.     '加入四个列首
  546.     .ColumnHeaders.Add , , "名称", 1200
  547.     .ColumnHeaders.Add , , "规格型号", 900
  548.     .ColumnHeaders.Add , , "维修车号", 1000
  549.     .ColumnHeaders.Add , , "计量单位", 900
  550.     .ColumnHeaders.Add , , "报件时间", 2300
  551.     .ColumnHeaders.Add , , "报件数量", 900
  552.   End With
  553. End Sub
  554. '将职员显示到ListView中
  555. Public Sub ClientsToListview(ByVal objClients As Recordset, ByRef lvw As ListView)
  556.   Dim i As Long
  557.   
  558.   If lvw.ColumnHeaders.Count = 0 Then InitClientListview lvw
  559.   lvw.ListItems.Clear '清除当前的列表内容
  560.   
  561.   For i = 1 To objClients.RecordCount
  562.     AddClientToLvw objClients.DataSource, lvw, False
  563.     objClients.MoveNext
  564.   Next i
  565. End Sub
  566. ' 显示全部客户到列表控件
  567. Public Sub ListAllClients(ByRef lvw As ListView)
  568.   Dim rstClients As New Recordset
  569.   Set rstClients = g_Conn.Execute(allSQL)
  570.   ClientsToListview rstClients, lvw
  571.   Set rstClients = Nothing
  572. End Sub
  573. Private Sub cmdAddNews_Click()
  574. frmAddPJ.carID = GetID(tvTreeView.SelectedItem.Key)
  575. If frmAddPJ.carID = 0 Then Exit Sub
  576. frmAddPJ.mvarViewType = vtadd
  577. frmAddPJ.Show vbModal
  578. If frmAddPJ.OK = True Then AddClientToLvw g_Conn.Execute(allSQL & " where id='" & MaxID("PeiJian", "ID") & "'"), lvListView, False
  579. End Sub
  580. Private Sub cmdDeletes_Click()
  581. 'If MsgBox("真的要删除“" & lvListView.SelectedItem.Text & "”吗?", vbQuestion + vbYesNo + _
  582.         vbDefaultButton2) = vbNo Then Exit Sub
  583. 'Dim ErrMsg As String
  584. 'If RunSql("Delete from PeiJian where ID=" & GetID(lvListView.SelectedItem.Key), ErrMsg) Then
  585. '    lvListView.ListItems.Remove (lvListView.SelectedItem.Index)
  586. 'Else
  587. '    MsgBox ErrMsg
  588. 'End If
  589. End Sub
  590. Private Sub cmdModifys_Click()
  591. If lvListView.SelectedItem Is Nothing Then Exit Sub
  592. frmAddPJ.mvarID = lvListView.SelectedItem.Key
  593. frmAddPJ.mvarViewType = vtModify
  594. frmAddPJ.Show vbModal
  595. If frmAddPJ.OK = True Then AddClientToLvw g_Conn.Execute(allSQL & " where id='" & GetID(lvListView.SelectedItem.Key) & "'"), lvListView, True
  596. End Sub
  597. Private Sub cmdAddNew_Click()
  598. End Sub
  599. Private Sub cmdClose_Click()
  600.     Unload Me
  601. End Sub
  602. Private Sub cmdDelete_Click()
  603. End Sub
  604. Private Sub cmdModify_Click()
  605. End Sub
  606. Private Sub Form_Load()
  607.     InitClientListview lvListView '初始化列表
  608. '    ListAllClients lvListView
  609.     TypeToTreeview tvTreeView
  610. End Sub
  611. Private Sub Form_Resize()
  612.     On Error Resume Next
  613.     If Me.Width < 3000 Then Me.Width = 3000
  614.     SizeControls imgSplitter.Left
  615. End Sub
  616. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  617.     With imgSplitter
  618.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  619.     End With
  620.     picSplitter.Visible = True
  621.     mbMoving = True
  622. End Sub
  623. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  624.     Dim sglPos As Single
  625.     
  626.     If mbMoving Then
  627.         sglPos = x + imgSplitter.Left
  628.         If sglPos < sglSplitLimit Then
  629.             picSplitter.Left = sglSplitLimit
  630.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  631.             picSplitter.Left = Me.Width - sglSplitLimit
  632.         Else
  633.             picSplitter.Left = sglPos
  634.         End If
  635.     End If
  636. End Sub
  637. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  638.     SizeControls picSplitter.Left
  639.     picSplitter.Visible = False
  640.     mbMoving = False
  641. End Sub
  642. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  643.     If Source = imgSplitter Then
  644.         SizeControls x
  645.     End If
  646. End Sub
  647. Sub SizeControls(x As Single)
  648.     On Error Resume Next
  649.     
  650.     '设置 Width 属性
  651.     If x < 1500 Then x = 1500
  652.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  653.     tvTreeView.Width = x
  654.     imgSplitter.Left = x
  655.     lvListView.Left = x + 40
  656.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  657.     lblTitle(0).Width = tvTreeView.Width
  658.     lblTitle(1).Left = lvListView.Left + 20
  659.     lblTitle(1).Width = lvListView.Width - 40
  660.     '设置 Top 属性
  661.   
  662.     If ToolBartb.Visible Then
  663.         tvTreeView.Top = ToolBartb.Height + picTitles.Height
  664.     Else
  665.         tvTreeView.Top = picTitles.Height
  666.     End If
  667.     lvListView.Top = tvTreeView.Top
  668.     
  669.     '设置 height 属性
  670.         tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  671.     lvListView.Height = tvTreeView.Height
  672.     imgSplitter.Top = tvTreeView.Top
  673.     imgSplitter.Height = tvTreeView.Height
  674. End Sub
  675. Public Sub TypeToTreeview(ByRef tvw As TreeView)
  676.   Dim i As Long
  677.   Dim Nd As Node
  678.   Dim Rs As Recordset
  679.   Set Nd = tvw.Nodes.Add(, , "A0", "所有车辆", "A0")
  680.   
  681.   Nd.Expanded = True
  682.   Nd.Selected = True
  683. Set Rs = g_Conn.Execute("select ID,carNo from Client")
  684.   For i = 1 To Rs.RecordCount
  685.     Set Nd = tvw.Nodes.Add("A0", tvwChild, "A" & Rs(0), Rs(1), "A1")
  686.     Nd.Expanded = True
  687.     '加载其下级客户类型节点
  688.  '   LoadSubNodes tvw, Nd, super.ID
  689.  Rs.MoveNext
  690.   Next i
  691. End Sub
  692. Public Sub AddTypeToTvw(ByRef tvw As TreeView)
  693.   On Error Resume Next
  694.     tvw.Nodes.Add "A0", tvwChild, "A" & MaxID("Client", "ID"), strName, "A1"
  695. End Sub
  696. Private Sub lvListView_DblClick()
  697. If lvListView.SelectedItem Is Nothing Then Exit Sub
  698. frmAddPJ.mvarID = lvListView.SelectedItem.Key
  699. frmAddPJ.mvarViewType = vtinfo
  700. frmAddPJ.Show vbModal
  701. End Sub
  702. Private Sub ToolBartb_ButtonClick(ByVal Button As MSComctlLib.Button)
  703. Select Case Button.Key
  704.     Case "new"
  705.         cmdAddNew_Click
  706.     Case "modi"
  707.         cmdModify_Click
  708.     Case "del"
  709.         cmdDelete_Click
  710.     Case "exit"
  711.         cmdClose_Click
  712.     Case "news"
  713.         If g_QX(4) Then cmdAddNews_Click Else MsgBox qMSG
  714.     Case "modis"
  715.         If g_QX(4) Then cmdModifys_Click Else MsgBox qMSG
  716.     Case "dels"
  717.         If g_QX(4) Then cmdDeletes_Click Else MsgBox qMSG
  718.     Case "infos"
  719.         lvListView_DblClick
  720.     Case "view"
  721.         If lvListView.View = lvwIcon Then
  722.             lvListView.View = lvwSmallIcon
  723.         ElseIf lvListView.View = lvwSmallIcon Then
  724.             lvListView.View = lvwList
  725.         ElseIf lvListView.View = lvwList Then
  726.             lvListView.View = lvwReport
  727.         ElseIf lvListView.View = lvwReport Then
  728.             lvListView.View = lvwIcon
  729.         End If
  730. End Select
  731. End Sub
  732. Private Sub ToolBartb_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
  733. Select Case ButtonMenu.Key
  734.     Case "dtb"
  735.         lvListView.View = lvwIcon
  736.     Case "xtb"
  737.         lvListView.View = lvwSmallIcon
  738.     Case "lb"
  739.         lvListView.View = lvwList
  740.     Case "xxzl"
  741.         lvListView.View = lvwReport
  742. End Select
  743. End Sub
  744. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  745. Dim khID As String
  746. khID = GetID(Me.tvTreeView.SelectedItem.Key)
  747. Dim Rst As New ADODB.Recordset
  748.     If khID = 0 Then
  749.         Set Rst = g_Conn.Execute(allSQL)
  750.     Else
  751.         Set Rst = g_Conn.Execute(allSQL & " where Pcid=" & khID)
  752.     End If
  753.     ClientsToListview Rst, lvListView
  754. End Sub