上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:32k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form Xt_Control 
  5.    Caption         =   "桌面"
  6.    ClientHeight    =   5850
  7.    ClientLeft      =   675
  8.    ClientTop       =   1665
  9.    ClientWidth     =   8880
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   8880
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.PictureBox picTitles 
  17.       Align           =   1  'Align Top
  18.       Appearance      =   0  'Flat
  19.       BorderStyle     =   0  'None
  20.       BeginProperty Font 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   400
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       ForeColor       =   &H80000008&
  30.       Height          =   300
  31.       Left            =   0
  32.       ScaleHeight     =   300
  33.       ScaleWidth      =   8880
  34.       TabIndex        =   2
  35.       TabStop         =   0   'False
  36.       Top             =   420
  37.       Width           =   8880
  38.       Begin VB.Label lblTitle 
  39.          BorderStyle     =   1  'Fixed Single
  40.          Caption         =   " 列表视图:"
  41.          Height          =   270
  42.          Index           =   1
  43.          Left            =   2078
  44.          TabIndex        =   4
  45.          Tag             =   " 列表视图:"
  46.          Top             =   12
  47.          Width           =   3216
  48.       End
  49.       Begin VB.Label lblTitle 
  50.          BorderStyle     =   1  'Fixed Single
  51.          Caption         =   "百利/ERP5.0"
  52.          Height          =   270
  53.          Index           =   0
  54.          Left            =   0
  55.          TabIndex        =   3
  56.          Tag             =   " 树形视图:"
  57.          Top             =   12
  58.          Width           =   2016
  59.       End
  60.    End
  61.    Begin VB.PictureBox picSplitter 
  62.       BackColor       =   &H00808080&
  63.       BorderStyle     =   0  'None
  64.       FillColor       =   &H00808080&
  65.       BeginProperty Font 
  66.          Name            =   "MS Sans Serif"
  67.          Size            =   8.25
  68.          Charset         =   0
  69.          Weight          =   400
  70.          Underline       =   0   'False
  71.          Italic          =   0   'False
  72.          Strikethrough   =   0   'False
  73.       EndProperty
  74.       Height          =   4800
  75.       Left            =   4740
  76.       ScaleHeight     =   2090.126
  77.       ScaleMode       =   0  'User
  78.       ScaleWidth      =   780
  79.       TabIndex        =   0
  80.       Top             =   780
  81.       Visible         =   0   'False
  82.       Width           =   72
  83.    End
  84.    Begin MSComctlLib.ImageList ImageList1 
  85.       Left            =   5220
  86.       Top             =   2340
  87.       _ExtentX        =   1005
  88.       _ExtentY        =   1005
  89.       BackColor       =   -2147483643
  90.       ImageWidth      =   16
  91.       ImageHeight     =   16
  92.       MaskColor       =   12632256
  93.       _Version        =   393216
  94.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  95.          NumListImages   =   7
  96.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  97.             Picture         =   "系统_主操作桌面.frx":1042
  98.             Key             =   "stb"
  99.          EndProperty
  100.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.             Picture         =   "系统_主操作桌面.frx":2094
  102.             Key             =   "xttb"
  103.          EndProperty
  104.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.             Picture         =   "系统_主操作桌面.frx":30E6
  106.             Key             =   "szk"
  107.          EndProperty
  108.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.             Picture         =   "系统_主操作桌面.frx":3480
  110.             Key             =   "gnqx1"
  111.          EndProperty
  112.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.             Picture         =   "系统_主操作桌面.frx":38D2
  114.             Key             =   "kpgl1"
  115.          EndProperty
  116.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.             Picture         =   "系统_主操作桌面.frx":41AC
  118.             Key             =   "kpgl"
  119.          EndProperty
  120.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.             Picture         =   "系统_主操作桌面.frx":51FE
  122.             Key             =   "gnqx"
  123.          EndProperty
  124.       EndProperty
  125.    End
  126.    Begin MSComctlLib.ListView lvListView 
  127.       Height          =   3375
  128.       Left            =   2160
  129.       TabIndex        =   1
  130.       Top             =   705
  131.       Width           =   2295
  132.       _ExtentX        =   4048
  133.       _ExtentY        =   5953
  134.       Arrange         =   2
  135.       LabelEdit       =   1
  136.       LabelWrap       =   -1  'True
  137.       HideSelection   =   -1  'True
  138.       OLEDragMode     =   1
  139.       OLEDropMode     =   1
  140.       PictureAlignment=   1
  141.       _Version        =   393217
  142.       Icons           =   "ImageList2"
  143.       SmallIcons      =   "ImageList1"
  144.       ColHdrIcons     =   "ImageList1"
  145.       ForeColor       =   -2147483640
  146.       BackColor       =   -2147483643
  147.       BorderStyle     =   1
  148.       Appearance      =   1
  149.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  150.          Name            =   "宋体"
  151.          Size            =   9
  152.          Charset         =   134
  153.          Weight          =   400
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       OLEDragMode     =   1
  159.       OLEDropMode     =   1
  160.       NumItems        =   0
  161.    End
  162.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  163.       Left            =   3360
  164.       Top             =   2160
  165.       _ExtentX        =   847
  166.       _ExtentY        =   847
  167.       _Version        =   393216
  168.    End
  169.    Begin MSComctlLib.TreeView tvTreeView 
  170.       Height          =   4800
  171.       Left            =   0
  172.       TabIndex        =   5
  173.       Top             =   705
  174.       Width           =   2010
  175.       _ExtentX        =   3545
  176.       _ExtentY        =   8467
  177.       _Version        =   393217
  178.       Indentation     =   564
  179.       Style           =   7
  180.       ImageList       =   "ImageList1"
  181.       Appearance      =   1
  182.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  183.          Name            =   "宋体"
  184.          Size            =   9
  185.          Charset         =   134
  186.          Weight          =   400
  187.          Underline       =   0   'False
  188.          Italic          =   0   'False
  189.          Strikethrough   =   0   'False
  190.       EndProperty
  191.    End
  192.    Begin MSComctlLib.Toolbar tbToolBar 
  193.       Align           =   1  'Align Top
  194.       Height          =   420
  195.       Left            =   0
  196.       TabIndex        =   6
  197.       Top             =   0
  198.       Width           =   8880
  199.       _ExtentX        =   15663
  200.       _ExtentY        =   741
  201.       ButtonWidth     =   609
  202.       ButtonHeight    =   582
  203.       AllowCustomize  =   0   'False
  204.       Appearance      =   1
  205.       ImageList       =   "imlToolbarIcons"
  206.       _Version        =   393216
  207.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  208.          NumButtons      =   10
  209.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  210.             Style           =   3
  211.          EndProperty
  212.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  213.             Key             =   "返回"
  214.             Object.ToolTipText     =   "返回"
  215.             ImageKey        =   "xq"
  216.          EndProperty
  217.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  218.             Key             =   "向前"
  219.             Object.ToolTipText     =   "向前"
  220.             ImageKey        =   "xh"
  221.          EndProperty
  222.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Style           =   3
  224.          EndProperty
  225.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  226.             Style           =   3
  227.          EndProperty
  228.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  229.             Style           =   3
  230.          EndProperty
  231.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  232.             Key             =   "大图标"
  233.             Object.ToolTipText     =   "大图标"
  234.             ImageKey        =   "dtb"
  235.             Style           =   2
  236.             Value           =   1
  237.          EndProperty
  238.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  239.             Key             =   "小图标"
  240.             Object.ToolTipText     =   "小图标"
  241.             ImageKey        =   "xtb"
  242.             Style           =   2
  243.          EndProperty
  244.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  245.             Key             =   "列表"
  246.             Object.ToolTipText     =   "列表"
  247.             ImageKey        =   "lb"
  248.             Style           =   2
  249.          EndProperty
  250.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  251.             Key             =   "详细资料"
  252.             Object.ToolTipText     =   "详细资料"
  253.             ImageKey        =   "xxzl"
  254.             Style           =   2
  255.          EndProperty
  256.       EndProperty
  257.    End
  258.    Begin MSComctlLib.ImageList imlToolbarIcons 
  259.       Left            =   4710
  260.       Top             =   840
  261.       _ExtentX        =   1005
  262.       _ExtentY        =   1005
  263.       BackColor       =   -2147483643
  264.       ImageWidth      =   16
  265.       ImageHeight     =   16
  266.       MaskColor       =   12632256
  267.       _Version        =   393216
  268.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  269.          NumListImages   =   6
  270.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  271.             Picture         =   "系统_主操作桌面.frx":5598
  272.             Key             =   "xq"
  273.          EndProperty
  274.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  275.             Picture         =   "系统_主操作桌面.frx":5932
  276.             Key             =   "xh"
  277.          EndProperty
  278.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  279.             Picture         =   "系统_主操作桌面.frx":5CCC
  280.             Key             =   "dtb"
  281.          EndProperty
  282.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.             Picture         =   "系统_主操作桌面.frx":6066
  284.             Key             =   "xtb"
  285.          EndProperty
  286.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  287.             Picture         =   "系统_主操作桌面.frx":6400
  288.             Key             =   "lb"
  289.          EndProperty
  290.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  291.             Picture         =   "系统_主操作桌面.frx":679A
  292.             Key             =   "xxzl"
  293.          EndProperty
  294.       EndProperty
  295.    End
  296.    Begin MSComctlLib.ImageList ImageList2 
  297.       Left            =   6210
  298.       Top             =   2370
  299.       _ExtentX        =   1005
  300.       _ExtentY        =   1005
  301.       BackColor       =   -2147483643
  302.       ImageWidth      =   32
  303.       ImageHeight     =   32
  304.       MaskColor       =   12632256
  305.       _Version        =   393216
  306.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  307.          NumListImages   =   4
  308.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.             Picture         =   "系统_主操作桌面.frx":6B34
  310.             Key             =   "y1"
  311.          EndProperty
  312.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.             Picture         =   "系统_主操作桌面.frx":6F88
  314.             Key             =   ""
  315.          EndProperty
  316.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.             Picture         =   "系统_主操作桌面.frx":72A8
  318.             Key             =   "i"
  319.          EndProperty
  320.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.             Picture         =   "系统_主操作桌面.frx":82FA
  322.             Key             =   "y"
  323.          EndProperty
  324.       EndProperty
  325.    End
  326.    Begin VB.Image imgSplitter 
  327.       Height          =   4785
  328.       Left            =   4230
  329.       MousePointer    =   9  'Size W E
  330.       Top             =   750
  331.       Width           =   150
  332.    End
  333. End
  334. Attribute VB_Name = "Xt_Control"
  335. Attribute VB_GlobalNameSpace = False
  336. Attribute VB_Creatable = False
  337. Attribute VB_PredeclaredId = True
  338. Attribute VB_Exposed = False
  339. '***********************************************
  340. '*    模 块 名 称 :系统主操作桌面
  341. '*    功 能 描 述 :
  342. '*    程序员姓名  :徐强
  343. '*    最后修改人  :徐强
  344. '*    最后修改时间:2001/06/21
  345. '***********************************************
  346. Const NAME_COLUMN = 0
  347. Const TYPE_COLUMN = 1
  348. Const SIZE_COLUMN = 2
  349. Const DATE_COLUMN = 3
  350. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  351.   
  352. Dim mbMoving As Boolean
  353. Const sglSplitLimit = 1000
  354. Dim nodX As Node
  355. Dim mitem As ListItem
  356. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  357. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  358. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  359. Dim Tsxx As String                           '系统提示信息
  360. Dim gnsyte As String                         '系统功能项索引
  361. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  362. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  363. Dim sjgnbmStr As String                      '上级编码
  364. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  365.     If lvListView.ListItems.Count > 0 Then
  366.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  367.         If Not Xtgnbrec.EOF Then
  368.             If Xtgnbrec.Fields("mjbz") = True Then
  369.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  370.                 Call Zxxymk(gnsyte)
  371.             Else
  372.                 '---------------
  373.                 Dim Ssql As String
  374.                 sjgnbmStr = ""
  375.                 lvListView.ColumnHeaders.Clear
  376.                 lvListView.ListItems.Clear
  377.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  378.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  379.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  380.                 Do While Not Xtgnbrec.EOF
  381.                     Set mitem = lvListView.ListItems.Add()
  382.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  383.                     If Xtgnbrec.Fields("mjbz") Then
  384.                         mitem.SmallIcon = "gnqx"
  385.                         mitem.Icon = "y"
  386.                     Else
  387.                         mitem.Icon = "i"
  388.                         mitem.SmallIcon = "stb"
  389.                     End If
  390.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  391.                     Xtgnbrec.MoveNext
  392.                 Loop
  393.                 '---------------
  394.             End If
  395.         End If
  396.     End If
  397. End Sub
  398. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  399.     If KeyAscii = vbKeyReturn Then
  400.         Call lvListView_DblClick
  401.     End If
  402. End Sub
  403. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  404.     Dim Ssql As String
  405.     If Node.Tag <> "" Then
  406.         If Node.Tag = False Then
  407.             Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "' and MenuList=1 order by gnbm"
  408.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  409.                 Exit Sub
  410.             Else
  411.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  412.             End If
  413.         Else
  414.             Ssql = "SELECT * FROM xt_xtgnb a," _
  415.                     & "(SELECT sjgnbm FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "')b" & " where a.sjgnbm=b.sjgnbm and MenuList=1 order by gnbm"
  416.         End If
  417.         
  418.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  419.         If Node.Tag = True Then
  420.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  421.                 Exit Sub
  422.             Else
  423.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  424.             End If
  425.         End If
  426.         lvListView.ColumnHeaders.Clear
  427.         lvListView.ListItems.Clear
  428.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  429.         Do While Not Xtgnbrec.EOF
  430.             Set mitem = lvListView.ListItems.Add()
  431.             mitem.Text = Trim(Xtgnbrec!gnmc)
  432.             If Xtgnbrec.Fields("mjbz") Then
  433.                 mitem.SmallIcon = "gnqx"
  434.                 mitem.Icon = "y"
  435.             Else
  436.                 mitem.Icon = "i"
  437.                 mitem.SmallIcon = "stb"
  438.             End If
  439.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  440.             Xtgnbrec.MoveNext
  441.         Loop
  442.     End If
  443. End Sub
  444. Public Sub Cshgns()                                                    '初始化系统功能树
  445.   
  446.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '16%' and MenuList=1 order by gnbm")
  447.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  448.     With Xtgnbrec
  449.         Do While Not .EOF
  450.             If .Fields("mjbz") Then
  451.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  452.             Else
  453.                 If Trim(.Fields("sjgnbm")) = "" Then
  454.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  455.                 Else
  456.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  457.                 End If
  458.             End If
  459.             nodX.Tag = Xtgnbrec!mjbz
  460.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  461.                 nodX.EnsureVisible
  462.             End If
  463.             .MoveNext
  464.         Loop
  465.     End With
  466. End Sub
  467. '系统功能树操作
  468. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  469.   Cancel = 1
  470. End Sub
  471. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  472.     
  473.     If Node.Index <> 1 And Node.Key <> "T16" Then
  474.         Node.Image = "stb"
  475.     End If
  476.  
  477. End Sub
  478. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  479.     
  480.     If Node.Index <> 1 And Node.Key <> "T16" Then
  481.         Node.Image = "szk"
  482.     End If
  483. End Sub
  484. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  485.     
  486.     If KeyAscii = vbKeyReturn Then
  487.         Call tvTreeView_DblClick
  488.     End If
  489. End Sub
  490. Private Sub tvTreeView_DblClick()                                             '选择功能
  491.     
  492.     If tvTreeView.SelectedItem.Children = 0 Then
  493.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  494.         If Not Xtgnbrec.EOF Then
  495.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  496.             Call Zxxymk(gnsyte)
  497.         End If
  498.     End If
  499. End Sub
  500. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  501.   
  502.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  503.     Dim Sqlstr As String                   '临时查询字符串
  504.   
  505.     If Len(Trim(gnsy)) = 0 Then
  506.         Exit Sub
  507.     End If
  508.     
  509.     On Error GoTo Cwcl:
  510.     Select Case gnsy
  511.         '文件
  512.         Case "Tr_register"                       '用户重新注册
  513.             XT_login.Show 1
  514.         Case "c_quit"
  515.             Unload XT_Main
  516.         
  517.             '模式程序
  518.      
  519.             '1.录入类型
  520.         Case "Tr_Type"                          '车辆类型(编码式)
  521.             Tr_Type.HelpContextID = 1602001
  522.             Tr_Type.Show 1
  523.         Case "Tr_Situation"                     '车辆状况(编码式)
  524.             Tr_Situation.HelpContextID = 1602002
  525.             Tr_Situation.Show 1
  526.         Case "Tr_UseNature"                     '车辆使用性质(编码式)
  527.             Tr_UseNature.HelpContextID = 1602003
  528.             Tr_UseNature.Show 1
  529.         Case "Tr_OwnerShip"                     '车辆所有权(编码式)
  530.             Tr_OwnerShip.HelpContextID = 1602004
  531.             Tr_OwnerShip.Show 1
  532.         Case "Tr_NowGrade"                      '车辆等级(编码式)
  533.             Tr_NowGrade.HelpContextID = 1602005
  534.             Tr_NowGrade.Show 1
  535.         Case "Tr_Park"                          '车辆停车线(编码式)
  536.             Tr_Park.HelpContextID = 1602006
  537.             Tr_Park.Show 1
  538.         Case "Tr_VehicleFile"                   '车辆档案(编码式)
  539.             Tr_VehicleFile.HelpContextID = 1602007
  540.             Call XtWaitMess("Tr_VehicleFile")
  541.         Case "Tr_TrainUnit"                     '接收单位
  542.             Tr_TrainUnit.HelpContextID = 1602008
  543.             Tr_TrainUnit.Show 1
  544.         Case "Tr_Source"                        '货源单位
  545.             Tr_Supply.HelpContextID = 1602009
  546.             Tr_Supply.Show 1
  547.         Case "Tr_DispatchOut"                   '调卸单(编码式)
  548.             Tr_DispatchOut.HelpContextID = 1603008001
  549.             Tr_DispatchOut.Show 1
  550.         Case "Tr_DispatchWash"                  '调洗单(编码式)
  551.             Tr_DispatchWash.HelpContextID = 1603008003
  552.             Tr_DispatchWash.Show 1
  553.         Case "Tr_Stop"                          '暂放单(编码式)
  554.             Tr_Stop.HelpContextID = 1603008004
  555.             Tr_Stop.Show 1
  556.         Case "Tr_Check"                         '查车单(编码式)
  557.             Tr_Check.HelpContextID = 1603008002
  558.             Tr_Check.Show 1
  559.         Case "Tr_Weigh"                         '检斤单(编码式)
  560.             Tr_Weigh.HelpContextID = 1603008005
  561.             Tr_Weigh.Show 1
  562.         Case "Tr_Move"                          '调车单(编码式)
  563.             Tr_Move.HelpContextID = 1603010
  564.             Tr_Move.Show 1
  565.         Case "Tr_Arrive"                         '车辆到达单(编码式)
  566.             Tr_Arrive.HelpContextID = 1603007
  567.             Tr_Arrive.Show 1
  568.         Case "Tr_NowAccountList"                '现车状况编码式)
  569.             Tr_NowAccountList.HelpContextID = 1603009
  570.             Tr_NowAccountList.Show
  571.             Tr_NowAccountCxtj.Show 1
  572.         Case "Tr_ParkList"                      '车辆在线状况(编码式)
  573.             Tr_ParkList.HelpContextID = 1603011
  574.             Tr_ParkList.Show
  575.             Tr_ParkCxtj.Show 1
  576.         Case "Tr_Apply"                         '货物运单
  577.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  578.             If Not Security_Log("Tr_Apply_edit", Xtczybm, 1) Then
  579.                 Exit Sub
  580.             End If
  581.             Xtcdcs = "1"
  582.             Tr_Apply.HelpContextID = 1603001
  583.             Tr_Apply.Show 1
  584.         Case "Tr_ApplyList"                     '货物运单列表
  585.             Tr_ApplyList.HelpContextID = 1603002
  586.             Tr_ApplyList.Show
  587.             Tr_ApplyListcxtj.Show 1
  588.         Case "Tr_Hold"                          '调装
  589.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  590.             If Not Security_Log("Tr_Hold_edit", Xtczybm, 1) Then
  591.                 Exit Sub
  592.             End If
  593.             Xtcdcs = "1"
  594.             Tr_Hold.HelpContextID = 1603003
  595.             Tr_Hold.Show 1
  596.         Case "Tr_HoldList"                      '调装列表
  597.             Xtcdcs = "1"
  598.             Tr_HoldList.HelpContextID = 1603004
  599.             Tr_HoldList.Show
  600.             Tr_HoldListcxtj.Show 1
  601.         Case "Tr_Invoice"                       '货票
  602.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  603.             If Not Security_Log("Tr_Invoice_edit", Xtczybm, 1) Then
  604.                 Exit Sub
  605.             End If
  606.             Xtcdcs = "1"
  607.             Tr_Invoice.HelpContextID = 1603005
  608.             Tr_Invoice.Show 1
  609.         Case "Tr_InvoiceList"                   '货票列表
  610.             Xtcdcs = "1"
  611.             Tr_InvoiceList.HelpContextID = 1603006
  612.             Tr_InvoiceList.Show
  613.             Tr_InvoiceListcxtj.Show 1
  614.         Case "Tr_Mend"                          '维修
  615.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  616.             If Not Security_Log("Tr_Mend_edit", Xtczybm, 1) Then
  617.                 Exit Sub
  618.             End If
  619.             Xtcdcs = "1"
  620.             Tr_Mend.HelpContextID = 1603012
  621.             Tr_Mend.Show 1
  622.         Case "Tr_MendList"                      '维修列表
  623.             Xtcdcs = "1"
  624.             Tr_MendList.HelpContextID = 1603013
  625.             Tr_MendList.Show
  626.             Tr_MendListcxtj.Show 1
  627.         Case "Tr_Roadlading"                    '汽运提货单
  628.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  629.             If Not Security_Log("Tr_Roadlading_edit", Xtczybm, 1) Then
  630.                 Exit Sub
  631.             End If
  632.             Xtcdcs = "1"
  633.             Tr_RoadLading.HelpContextID = 1604001
  634.             Tr_RoadLading.Show 1
  635.         Case "Tr_RoadLadingList"                '汽运提货单列表
  636.             Tr_Roadlad_list.HelpContextID = 1604002
  637.             Tr_Roadlad_list.Show
  638.             Tr_roadladcxtj.Show 1
  639.         Case "Tr_RoadOuting"                    '汽运卸货单
  640.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  641.             If Not Security_Log("Tr_RoadOuting_edit", Xtczybm, 1) Then
  642.                 Exit Sub
  643.             End If
  644.             Xtcdcs = "1"
  645.             Tr_RoadOuting.HelpContextID = 1604001
  646.             Tr_RoadOuting.Show 1
  647.         Case "Tr_RoadOutingList"                 '汽运卸货单列表
  648.             Tr_Roadout_list.HelpContextID = 1604002
  649.             Tr_Roadout_list.Show
  650.             Tr_RoadOutcxtj.Show 1
  651.         Case "Tr_RoadDeliver"                    '汽运送货单
  652.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  653.             If Not Security_Log("Tr_RoadDeliver_edit", Xtczybm, 1) Then
  654.                 Exit Sub
  655.             End If
  656.             Xtcdcs = "1"
  657.             Tr_RoadDeliver.HelpContextID = 1604003
  658.             Tr_RoadDeliver.Show 1
  659.         Case "Tr_RoadDeliverList"                '汽运送货单列表
  660.             Tr_RoadDeliverList.HelpContextID = 1604004
  661.             Tr_RoadDeliverList.Show
  662.             Tr_roadDelivercxtj.Show 1
  663.         Case "Tr_ShipDeliver"                    '水运送货单
  664.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  665.             If Not Security_Log("Tr_ShipDeliver_edit", Xtczybm, 1) Then
  666.                 Exit Sub
  667.             End If
  668.             Xtcdcs = "1"
  669.             Tr_ShipDeliver.HelpContextID = 1604005
  670.             Tr_ShipDeliver.Show 1
  671.         Case "Tr_ShipDeliverList"                '水运送货单列表
  672.             Tr_ShipDeliverList.HelpContextID = 1604006
  673.             Tr_ShipDeliverList.Show
  674.             Tr_ShipDelivercxtj.Show 1
  675.         
  676.         Case "Tr_TrainAccount"                   '铁运台帐
  677.             Tr_TrainAccount.HelpContextID = 1605001
  678.             Tr_TrainAccount.Show
  679.             Tr_TrainAccountcxtj.Show 1
  680.         Case "Tr_UseReport"                      '铁路运用统计表
  681.             Tr_UseReport.HelpContextID = 1605002
  682.             Tr_UseReport.Show
  683.             Tr_UseReportcxtj.Show 1
  684.         Case "Tr_WorkReport"                     '铁运运输工作统计表
  685.             Tr_WorkReport.HelpContextID = 1605003
  686.             Tr_WorkReport.Show
  687.             Tr_WorkReportcxtj.Show 1
  688.         Case "Tr_DateReport"                     '铁运日统计表
  689.             Tr_DateReport.HelpContextID = 1605004
  690.             Tr_DateReport.Show
  691.             Tr_DateReportcxtj.Show 1
  692.             
  693.         '工具
  694.         Case "c_gnbmkmrl"                        '会计日历
  695.             XT_kjrlFrm.Show 1
  696.         Case "c_gnbmjsq"                         '计算器
  697.             Shell App.Path & "calc.exe", vbNormalFocus
  698.         
  699.         '帮助
  700.         Case "Tr_SystempHelp"                    '系统帮助
  701.             Call F1bz
  702.         Case "Tr_About"                          '关于
  703.             XT_frmAbout.Show
  704.     End Select
  705.     
  706.     '用户退出时写上机日志
  707.    Security_Log gnsy, Xtczybm, 2, False
  708.    
  709.     Exit Sub
  710. Cwcl:
  711.     Tsxx = "此项系统功能有待完善!"
  712.     Call Xtxxts(Tsxx, 0, 4)
  713.     Exit Sub
  714. End Sub
  715. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  716.   
  717.     If Unload_TF = False Then
  718.         Cancel = 1
  719.         Me.WindowState = 1
  720.     End If
  721. End Sub
  722. Private Sub Form_Load()
  723.     
  724.     '设置窗体图标
  725.     Me.Icon = XT_Main.Icon
  726.     
  727.     '设置窗体位置大小,并调入系统功能树
  728.     Me.Left = 0
  729.     Me.Top = 0
  730.     Me.Width = XT_Main.Width - 60
  731.     Me.Height = XT_Main.Height - 760 - 690
  732.     Call Cshgns
  733.     
  734.     '启动调入数据等待提示
  735.     Load Xt_Wait
  736.     
  737. End Sub
  738. Private Sub Form_Unload(Cancel As Integer)
  739.     
  740.     On Error Resume Next
  741.     
  742.     Dim i As Integer
  743.     For i = Forms.Count - 1 To 1 Step -1
  744.         Unload Forms(i)
  745.     Next
  746.     If Me.WindowState <> vbMinimized Then
  747.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  748.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  749.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  750.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  751.     End If
  752.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  753. End Sub
  754. Private Sub Form_Resize()
  755.     
  756.     On Error Resume Next
  757.     If Me.Width < 3000 Then Me.Width = 3000
  758.     SizeControls imgSplitter.Left
  759. End Sub
  760. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  761.     
  762.     With imgSplitter
  763.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  764.     End With
  765.     picSplitter.Visible = True
  766.     mbMoving = True
  767. End Sub
  768. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  769.     
  770.     Dim sglPos As Single
  771.     If mbMoving Then
  772.         sglPos = x + imgSplitter.Left
  773.         If sglPos < sglSplitLimit Then
  774.             picSplitter.Left = sglSplitLimit
  775.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  776.             picSplitter.Left = Me.Width - sglSplitLimit
  777.         Else
  778.             picSplitter.Left = sglPos
  779.         End If
  780.     End If
  781. End Sub
  782. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  783.     
  784.     SizeControls picSplitter.Left
  785.     picSplitter.Visible = False
  786.     mbMoving = False
  787.     lvListView.Refresh
  788. End Sub
  789. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  790.     
  791.     If Source = imgSplitter Then
  792.         SizeControls x
  793.     End If
  794. End Sub
  795. Sub SizeControls(x As Single)
  796.     
  797.     On Error Resume Next
  798.     '设置 Width 属性
  799.     If x < 3500 Then x = 3500
  800.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  801.     tvTreeView.Width = x
  802.     imgSplitter.Left = x
  803.     lvListView.Left = x + 40
  804.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  805.     lblTitle(0).Width = tvTreeView.Width
  806.     lblTitle(1).Left = lvListView.Left + 20
  807.     lblTitle(1).Width = lvListView.Width - 40
  808.     '设置 Top 属性
  809.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  810.     lvListView.Top = tvTreeView.Top
  811.     '设置 height 属性
  812.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  813.     
  814.     lvListView.Height = tvTreeView.Height
  815.     imgSplitter.Top = tvTreeView.Top
  816.     imgSplitter.Height = tvTreeView.Height
  817. End Sub
  818. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  819.     
  820.     On Error Resume Next
  821.     
  822.     Select Case Button.Key
  823.         Case "返回"
  824.             tvTreeView.SetFocus
  825.               SendKeys "{up}", True
  826.         Case "向前"
  827.              tvTreeView.SetFocus
  828.               SendKeys "{DOWN}", True
  829.         Case "大图标"
  830.             lvListView.View = lvwIcon
  831.         Case "小图标"
  832.             lvListView.View = lvwSmallIcon
  833.         Case "列表"
  834.             lvListView.View = lvwList
  835.         Case "详细资料"
  836.             lvListView.View = lvwReport
  837.     End Select
  838. End Sub