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

百货/超市行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmDataList 
  4.    ClientHeight    =   6105
  5.    ClientLeft      =   5310
  6.    ClientTop       =   5040
  7.    ClientWidth     =   9615
  8.    Icon            =   "frmDataList.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   6105
  12.    ScaleWidth      =   9615
  13.    WindowState     =   2  'Maximized
  14.    Begin MSComctlLib.ListView ListView1 
  15.       Height          =   5160
  16.       Left            =   120
  17.       TabIndex        =   0
  18.       Top             =   600
  19.       Width           =   9135
  20.       _ExtentX        =   16113
  21.       _ExtentY        =   9102
  22.       View            =   3
  23.       LabelEdit       =   1
  24.       LabelWrap       =   0   'False
  25.       HideSelection   =   0   'False
  26.       AllowReorder    =   -1  'True
  27.       FullRowSelect   =   -1  'True
  28.       GridLines       =   -1  'True
  29.       _Version        =   393217
  30.       SmallIcons      =   "ImageList2"
  31.       ForeColor       =   -2147483640
  32.       BackColor       =   -2147483643
  33.       Appearance      =   1
  34.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  35.          Name            =   "宋体"
  36.          Size            =   9
  37.          Charset         =   134
  38.          Weight          =   400
  39.          Underline       =   0   'False
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.       NumItems        =   0
  44.    End
  45.    Begin MSComctlLib.Toolbar ToolBartb 
  46.       Align           =   1  'Align Top
  47.       Height          =   585
  48.       Left            =   0
  49.       TabIndex        =   1
  50.       Top             =   0
  51.       Width           =   9615
  52.       _ExtentX        =   16960
  53.       _ExtentY        =   1032
  54.       ButtonWidth     =   820
  55.       ButtonHeight    =   979
  56.       Appearance      =   1
  57.       Style           =   1
  58.       ImageList       =   "ImageList2"
  59.       _Version        =   393216
  60.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  61.          NumButtons      =   6
  62.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  63.             Caption         =   "导出"
  64.             Key             =   "xls"
  65.             ImageKey        =   "xls"
  66.          EndProperty
  67.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  68.             Caption         =   "查找"
  69.             Key             =   "find"
  70.             ImageKey        =   "cz"
  71.          EndProperty
  72.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  73.             Caption         =   "刷新"
  74.             Key             =   "f5"
  75.             ImageKey        =   "f5"
  76.          EndProperty
  77.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  78.             Caption         =   "打印"
  79.             Key             =   "print"
  80.             ImageKey        =   "print"
  81.          EndProperty
  82.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  83.             Style           =   3
  84.          EndProperty
  85.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  86.             Caption         =   "关闭"
  87.             Key             =   "exit"
  88.             ImageKey        =   "exit"
  89.          EndProperty
  90.       EndProperty
  91.    End
  92.    Begin MSComctlLib.ImageList ImageList2 
  93.       Left            =   9120
  94.       Top             =   5520
  95.       _ExtentX        =   1005
  96.       _ExtentY        =   1005
  97.       BackColor       =   -2147483643
  98.       ImageWidth      =   16
  99.       ImageHeight     =   16
  100.       MaskColor       =   12632256
  101.       _Version        =   393216
  102.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  103.          NumListImages   =   33
  104.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.             Picture         =   "frmDataList.frx":12FA
  106.             Key             =   "A2"
  107.          EndProperty
  108.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.             Picture         =   "frmDataList.frx":1BD4
  110.             Key             =   "A1"
  111.          EndProperty
  112.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.             Picture         =   "frmDataList.frx":269E
  114.             Key             =   "A0"
  115.          EndProperty
  116.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.             Picture         =   "frmDataList.frx":2F78
  118.             Key             =   ""
  119.          EndProperty
  120.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.             Picture         =   "frmDataList.frx":3B22
  122.             Key             =   ""
  123.          EndProperty
  124.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  125.             Picture         =   "frmDataList.frx":40BC
  126.             Key             =   ""
  127.          EndProperty
  128.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  129.             Picture         =   "frmDataList.frx":4656
  130.             Key             =   ""
  131.          EndProperty
  132.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  133.             Picture         =   "frmDataList.frx":4BF0
  134.             Key             =   "gb"
  135.          EndProperty
  136.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  137.             Picture         =   "frmDataList.frx":573A
  138.             Key             =   ""
  139.          EndProperty
  140.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  141.             Picture         =   "frmDataList.frx":B35C
  142.             Key             =   ""
  143.          EndProperty
  144.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  145.             Picture         =   "frmDataList.frx":B8F6
  146.             Key             =   ""
  147.          EndProperty
  148.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  149.             Picture         =   "frmDataList.frx":BA50
  150.             Key             =   ""
  151.          EndProperty
  152.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  153.             Picture         =   "frmDataList.frx":BBAA
  154.             Key             =   ""
  155.          EndProperty
  156.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  157.             Picture         =   "frmDataList.frx":BD04
  158.             Key             =   "f5"
  159.          EndProperty
  160.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  161.             Picture         =   "frmDataList.frx":BE5E
  162.             Key             =   ""
  163.          EndProperty
  164.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  165.             Picture         =   "frmDataList.frx":BFB8
  166.             Key             =   "del"
  167.          EndProperty
  168.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  169.             Picture         =   "frmDataList.frx":C112
  170.             Key             =   "cz"
  171.          EndProperty
  172.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  173.             Picture         =   "frmDataList.frx":C26C
  174.             Key             =   "sboy"
  175.          EndProperty
  176.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  177.             Picture         =   "frmDataList.frx":C3C6
  178.             Key             =   "bboy"
  179.          EndProperty
  180.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  181.             Picture         =   "frmDataList.frx":C960
  182.             Key             =   "view"
  183.          EndProperty
  184.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  185.             Picture         =   "frmDataList.frx":CEFA
  186.             Key             =   ""
  187.          EndProperty
  188.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  189.             Picture         =   "frmDataList.frx":D494
  190.             Key             =   "save"
  191.          EndProperty
  192.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  193.             Picture         =   "frmDataList.frx":DA2E
  194.             Key             =   "cute"
  195.          EndProperty
  196.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  197.             Picture         =   "frmDataList.frx":DFC8
  198.             Key             =   "copy"
  199.          EndProperty
  200.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  201.             Picture         =   "frmDataList.frx":E562
  202.             Key             =   "paste"
  203.          EndProperty
  204.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  205.             Picture         =   "frmDataList.frx":EAFC
  206.             Key             =   "xg"
  207.          EndProperty
  208.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  209.             Picture         =   "frmDataList.frx":F096
  210.             Key             =   "serch"
  211.          EndProperty
  212.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  213.             Picture         =   "frmDataList.frx":F630
  214.             Key             =   "info"
  215.          EndProperty
  216.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  217.             Picture         =   "frmDataList.frx":FBCA
  218.             Key             =   ""
  219.          EndProperty
  220.          BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  221.             Picture         =   "frmDataList.frx":10164
  222.             Key             =   ""
  223.          EndProperty
  224.          BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  225.             Picture         =   "frmDataList.frx":106FE
  226.             Key             =   "print"
  227.          EndProperty
  228.          BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  229.             Picture         =   "frmDataList.frx":10C98
  230.             Key             =   "exit"
  231.          EndProperty
  232.          BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  233.             Picture         =   "frmDataList.frx":11072
  234.             Key             =   "xls"
  235.          EndProperty
  236.       EndProperty
  237.    End
  238. End
  239. Attribute VB_Name = "frmDataList"
  240. Attribute VB_GlobalNameSpace = False
  241. Attribute VB_Creatable = False
  242. Attribute VB_PredeclaredId = True
  243. Attribute VB_Exposed = False
  244. '****************************************************************************
  245. '人人为我,我为人人
  246. '枕善居收藏整理
  247. '发布日期:2008/01/21
  248. '描    述:汽车维修管理系统SQL2000版
  249. '网    站:http://www.Mndsoft.com/  (VB6源码博客)
  250. '网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
  251. 'e-mail  :Mndsoft@163.com
  252. 'e-mail  :Mndsoft@126.com
  253. 'OICQ    :88382850
  254. '          如果您有新的好的代码别忘记给枕善居哦!
  255. '****************************************************************************
  256. Option Explicit
  257. Private Const MARGIN_SIZE = 60      ' 单位为缇
  258. Const sSQL As String = "Select * from V_Serch"
  259. Public Sub ObjToLv(ByVal objClients As Recordset, Optional ByRef lvw As ListView)
  260.   Dim i As Long
  261. If lvw Is Nothing Then Set lvw = ListView1
  262.   
  263.   If lvw.ColumnHeaders.Count = 0 Then InitListview lvw
  264.   lvw.ListItems.Clear '清除当前的列表内容
  265.   
  266.   For i = 1 To objClients.RecordCount
  267.     FindRst objClients.DataSource, lvw
  268.     objClients.MoveNext
  269.   Next i
  270. End Sub
  271. Public Sub FindRst(ByVal objClient As Recordset, Optional ByRef lvw As ListView)
  272.   Dim itm As ListItem
  273.   Dim sIcon As String
  274.   Dim bIcon As String
  275.     sIcon = "sboy"
  276.     bIcon = "bboy"
  277.     Set itm = lvw.ListItems.Add(, , , , sIcon)
  278.   With objClient  '这里要与InitClientListview相对应
  279.     itm.SmallIcon = sIcon
  280. '    itm.Icon = bIcon
  281.     itm.Text = .Fields("carNo").Value
  282.     itm.SubItems(1) = .Fields("inDate").Value
  283.     itm.SubItems(2) = .Fields("pName").Value
  284.     itm.SubItems(3) = .Fields("pDate").Value
  285.     itm.SubItems(4) = Val(.Fields("pNum").Value)
  286.     itm.SubItems(5) = IIf(IsNull(.Fields("sNum").Value), "——", .Fields("sNum").Value)
  287.     itm.SubItems(6) = IIf(IsNull(.Fields("pPrice").Value), "——", .Fields("pPrice").Value)
  288.     itm.SubItems(7) = IIf(IsNull(.Fields("sNum").Value), "——", .Fields("sNum").Value * .Fields("pPrice").Value)
  289.     itm.SubItems(8) = IIf(IsNull(.Fields("FDate").Value), "——", .Fields("Fdate").Value)
  290.     itm.SubItems(9) = IIf(IsNull(.Fields("pBak").Value), "尚未采购", .Fields("pBak").Value)
  291.   End With
  292.   Set itm = Nothing
  293. End Sub
  294. Private Sub InitListview(ByRef lvw As ListView)
  295.   With lvw
  296.     .ColumnHeaders.Clear
  297.     '加入四个列首
  298.     .ColumnHeaders.Add , , "车牌号", 1500
  299.     .ColumnHeaders.Add , , "入场时间", 2100
  300.     .ColumnHeaders.Add , , "报件名称", 1600
  301.     .ColumnHeaders.Add , , "报件时间", 2100
  302.     .ColumnHeaders.Add , , "报件数量", 900
  303.     .ColumnHeaders.Add , , "采购数量", 900
  304.     .ColumnHeaders.Add , , "采购单价", 900
  305.     .ColumnHeaders.Add , , "采购金额", 1000
  306.     .ColumnHeaders.Add , , "采购时间", 2100
  307.     .ColumnHeaders.Add , , "备注", 2000
  308.   End With
  309. End Sub
  310. Private Sub Form_Load()
  311. InitListview ListView1
  312. End Sub
  313. Private Sub Form_Resize()
  314. Dim sngButtonTop As Single
  315. Dim sngScaleWidth As Single
  316. Dim sngScaleHeight As Single
  317. On Error Resume Next
  318. With Me
  319.     sngScaleWidth = .ScaleWidth
  320.     sngScaleHeight = .ScaleHeight
  321. .ListView1.Move MARGIN_SIZE, ToolBartb.Height + MARGIN_SIZE, sngScaleWidth - (2 * MARGIN_SIZE), sngScaleHeight - (ToolBartb.Height + 3 * MARGIN_SIZE)
  322. End With
  323. Exit Sub
  324. End Sub
  325. Private Sub ToolBartb_ButtonClick(ByVal Button As MSComctlLib.Button)
  326. Select Case Button.Key
  327.     Case "find"
  328.         frmFindCG.Show vbModal
  329.     Case "print"
  330.         MsgBox "该功能尚未完成"
  331.     Case "xls"
  332.         ListViewToExcel ListView1
  333.     Case "f5"
  334.         MsgBox "该功能尚未完成"
  335.     Case "exit"
  336.         Unload Me
  337. End Select
  338. End Sub
  339. Private Sub ToolBartb_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
  340. Select Case ButtonMenu.Key
  341.     Case "dtb"
  342.         ListView1.View = lvwIcon
  343.     Case "xtb"
  344.         ListView1.View = lvwSmallIcon
  345.     Case "lb"
  346.         ListView1.View = lvwList
  347.     Case "xxzl"
  348.         ListView1.View = lvwReport
  349. End Select
  350. End Sub