frmGS.frm
上传用户:yexiandon
上传日期:2022-07-12
资源大小:895k
文件大小:29k
- 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 frmGS
- Caption = "工时信息"
- ClientHeight = 5940
- ClientLeft = 1860
- ClientTop = 5520
- ClientWidth = 15240
- Icon = "frmGS.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 = "frmGS.frx":08CA
- Key = "A2"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":11A4
- Key = "A1"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":1C6E
- Key = "A0"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":2548
- Key = ""
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":30F2
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":368C
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":3C26
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":41C0
- Key = "gb"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":4D0A
- Key = ""
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":A92C
- Key = ""
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":AEC6
- Key = ""
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B020
- Key = ""
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B17A
- Key = ""
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B2D4
- Key = "f5"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B42E
- Key = ""
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B588
- Key = "del"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B6E2
- Key = "cz"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B83C
- Key = ""
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":B996
- Key = "new"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":BF30
- Key = "view"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":C4CA
- Key = ""
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":CA64
- Key = "save"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":CFFE
- Key = "cute"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":D598
- Key = "copy"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":DB32
- Key = "paste"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":E0CC
- Key = "xg"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":E666
- Key = "serch"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":EC00
- Key = "info"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":F19A
- Key = ""
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":F734
- Key = ""
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":FCCE
- Key = ""
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":10268
- Key = "exit"
- EndProperty
- EndProperty
- End
- Begin VB.PictureBox picSplitter
- BackColor = &H00808080&
- BorderStyle = 0 'None
- FillColor = &H00808080&
- Height = 4920
- Left = 2040
- ScaleHeight = 2142.379
- ScaleMode = 0 'User
- ScaleWidth = 780
- TabIndex = 6
- Top = 945
- Visible = 0 'False
- Width = 72
- End
- Begin MSComctlLib.TreeView tvTreeView
- Height = 4920
- Left = 0
- TabIndex = 5
- Top = 945
- Width = 2010
- _ExtentX = 3545
- _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 = 2055
- TabIndex = 4
- Top = 945
- Width = 14490
- _ExtentX = 25559
- _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 = 2085
- TabIndex = 3
- Tag = " 列表视图:"
- Top = 15
- Width = 12930
- End
- Begin VB.Label lblTitle
- BorderStyle = 1 'Fixed Single
- Caption = " 车辆:"
- Height = 270
- Index = 0
- Left = 0
- TabIndex = 2
- Tag = " 树形视图:"
- Top = 12
- Width = 2016
- 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 = 979
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 12
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "新增"
- Key = "new"
- ImageKey = "new"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "modi"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "del"
- ImageKey = "del"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查看"
- Key = "info"
- ImageKey = "info"
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "新增"
- Key = "news"
- ImageKey = "new"
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "modis"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "dels"
- ImageKey = "del"
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查看"
- Key = "infos"
- ImageKey = "info"
- EndProperty
- BeginProperty Button10 {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 Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {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 = "frmGS.frx":10642
- Key = "boy"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":10A94
- Key = "girl"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":10EE6
- Key = "bboy1"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":11F3A
- Key = "bgirl"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":12F8E
- Key = "group"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":15740
- Key = "add"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":15B92
- Key = "modify2"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":15FE4
- Key = "modify"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":162FE
- Key = "del"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":16458
- Key = "info"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":169F2
- Key = "info2"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":18CA4
- Key = "search"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":1923E
- Key = "warn"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":195D8
- Key = "setting"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":198F2
- Key = "lstView"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":19C0C
- Key = "exit"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.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 = "frmGS.frx":20AF8
- Key = "group"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":20F4A
- Key = "group2"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":236FC
- Key = "boy"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":23B4E
- Key = "girl"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":23FA0
- Key = "sboy1"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":243F4
- Key = "sgirl"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmGS.frx":24848
- Key = "sboy"
- EndProperty
- EndProperty
- End
- Begin VB.Image imgSplitter
- Height = 4785
- Left = 1965
- MousePointer = 9 'Size W E
- Top = 945
- Width = 150
- End
- End
- Attribute VB_Name = "frmGS"
- 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,wName,wFdate,wTdate,wMin,carID,cID,wPrice,wDemo from WeiXiu"
- 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
- 'If objClient("clkSex") = Male Then
- sIcon = "sboy"
- bIcon = "bboy"
- 'Else
- ' sIcon = "sgirl"
- ' bIcon = "bgirl"
- 'End If
-
- '如果是更新(即覆盖),则使用当前选种的元素
- 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 = .Fields(1).Value
- itm.SubItems(1) = GetValueByID("Client", "ID", .Fields("carID").Value, "carNo")
- itm.SubItems(2) = .Fields(2).Value
- itm.SubItems(3) = .Fields(3).Value
- itm.SubItems(4) = .Fields(4).Value
- itm.SubItems(5) = .Fields(7).Value
- itm.SubItems(6) = .Fields(7).Value * .Fields(4).Value
- itm.SubItems(7) = GetValueByID("Clerk", "clkID", .Fields("cID").Value, "clkName")
- itm.SubItems(8) = .Fields(8).Value
- End With
- Set itm = Nothing
- End Sub
- '按照“客户”设置ListView的显示样式
- Public Sub InitClientListview(ByRef lvw As ListView)
- With lvw
- .ColumnHeaders.Clear
- '加入四个列首
- .ColumnHeaders.Add , , "名称", 1200
- .ColumnHeaders.Add , , "维修车号", 1000
- .ColumnHeaders.Add , , "开始时间", 2100
- .ColumnHeaders.Add , , "结束时间", 2100
- .ColumnHeaders.Add , , "工时", 900
- .ColumnHeaders.Add , , "单价", 800
- .ColumnHeaders.Add , , "金额", 800
- .ColumnHeaders.Add , , "维修人", 800
- .ColumnHeaders.Add , , "备注", 1900
- 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()
- frmAddGS.mvarViewType = vtadd
- frmAddGS.carID = GetID(tvTreeView.SelectedItem.Key)
- frmAddGS.Show vbModal
- If frmAddGS.OK = True Then AddClientToLvw g_Conn.Execute(allSQL & " where id='" & MaxID("WeiXiu", "ID") & "'"), lvListView, False
- End Sub
- Private Sub cmdDeletes_Click()
- If MsgBox("真的要删除“" & lvListView.SelectedItem.Text & "”吗?", vbQuestion + vbYesNo + _
- vbDefaultButton2) = vbNo Then Exit Sub
- Dim ErrMsg As String
- If RunSql("Delete from WeiXiu where ID=" & GetID(lvListView.SelectedItem.Key), ErrMsg) Then
- lvListView.ListItems.Remove (lvListView.SelectedItem.Index)
- Else
- MsgBox ErrMsg
- End If
- End Sub
- Private Sub cmdModifys_Click()
- If lvListView.ListItems.Count = 0 Then Exit Sub
- frmAddGS.mvarID = lvListView.SelectedItem.Key
- frmAddGS.mvarViewType = vtModify
- frmAddGS.Show vbModal
- If frmAddGS.OK = True Then AddClientToLvw g_Conn.Execute(allSQL & " where id='" & GetID(lvListView.SelectedItem.Key) & "'"), lvListView, True
- End Sub
- Private Sub cmdAddNew_Click()
- End Sub
- Private Sub cmdClose_Click()
- Unload Me
- End Sub
- Private Sub cmdDelete_Click()
- End Sub
- Private Sub cmdModify_Click()
- End Sub
- Private Sub Form_Load()
- InitClientListview lvListView '初始化列表
- ' ListAllClients 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 ID,carNo from Client")
- For i = 1 To Rs.RecordCount
- Set Nd = tvw.Nodes.Add("A0", tvwChild, "A" & Rs(0), Rs(1), "A1")
- Nd.Expanded = True
- '加载其下级客户类型节点
- ' LoadSubNodes tvw, Nd, super.ID
- Rs.MoveNext
- Next i
- End Sub
- Public Sub AddTypeToTvw(ByRef tvw As TreeView)
- On Error Resume Next
- tvw.Nodes.Add "A0", tvwChild, "A" & MaxID("Client", "ID"), strName, "A1"
- End Sub
- Private Sub lvListView_DblClick()
- If lvListView.SelectedItem Is Nothing Then Exit Sub
- frmAddGS.mvarID = lvListView.SelectedItem.Key
- frmAddGS.mvarViewType = vtinfo
- frmAddGS.Show vbModal
- End Sub
- Private Sub ToolBartb_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "new"
- cmdAddNew_Click
- Case "modi"
- cmdModify_Click
- Case "del"
- cmdDelete_Click
- Case "exit"
- cmdClose_Click
- Case "news"
- If g_QX(7) Then cmdAddNews_Click Else MsgBox qMSG
- Case "modis"
- If g_QX(7) Then cmdModifys_Click Else MsgBox qMSG
- Case "dels"
- If g_QX(7) Then cmdDeletes_Click Else MsgBox qMSG
- Case "infos"
- lvListView_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_NodeClick(ByVal Node As MSComctlLib.Node)
- Dim khID As String
- khID = GetID(Me.tvTreeView.SelectedItem.Key)
- Dim Rst As New ADODB.Recordset
- If khID = 0 Then
- Set Rst = g_Conn.Execute(allSQL)
- Else
- Set Rst = g_Conn.Execute(allSQL & " where carID=" & khID)
- End If
- ClientsToListview Rst, lvListView
- End Sub