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

企业管理

开发平台:

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     =   9240
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   9240
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.PictureBox picSplitter 
  17.       BackColor       =   &H00808080&
  18.       BorderStyle     =   0  'None
  19.       FillColor       =   &H00808080&
  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.       Height          =   4800
  30.       Left            =   4740
  31.       ScaleHeight     =   2090.126
  32.       ScaleMode       =   0  'User
  33.       ScaleWidth      =   780
  34.       TabIndex        =   0
  35.       Top             =   780
  36.       Visible         =   0   'False
  37.       Width           =   72
  38.    End
  39.    Begin MSComctlLib.ImageList ImageList1 
  40.       Left            =   5220
  41.       Top             =   2340
  42.       _ExtentX        =   1005
  43.       _ExtentY        =   1005
  44.       BackColor       =   -2147483643
  45.       ImageWidth      =   16
  46.       ImageHeight     =   16
  47.       MaskColor       =   12632256
  48.       _Version        =   393216
  49.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  50.          NumListImages   =   6
  51.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.             Picture         =   "系统_主操作桌面.frx":08CA
  53.             Key             =   "stb"
  54.          EndProperty
  55.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "系统_主操作桌面.frx":191C
  57.             Key             =   "xttb"
  58.          EndProperty
  59.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "系统_主操作桌面.frx":296E
  61.             Key             =   "szk"
  62.          EndProperty
  63.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "系统_主操作桌面.frx":2D08
  65.             Key             =   "gnqx1"
  66.          EndProperty
  67.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "系统_主操作桌面.frx":315A
  69.             Key             =   "gnqx"
  70.          EndProperty
  71.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  72.             Picture         =   "系统_主操作桌面.frx":34F4
  73.             Key             =   "kpgl"
  74.          EndProperty
  75.       EndProperty
  76.    End
  77.    Begin MSComctlLib.ListView lvListView 
  78.       Height          =   3375
  79.       Left            =   2160
  80.       TabIndex        =   5
  81.       Top             =   705
  82.       Width           =   2295
  83.       _ExtentX        =   4048
  84.       _ExtentY        =   5953
  85.       Arrange         =   2
  86.       LabelEdit       =   1
  87.       LabelWrap       =   -1  'True
  88.       HideSelection   =   -1  'True
  89.       OLEDragMode     =   1
  90.       OLEDropMode     =   1
  91.       PictureAlignment=   1
  92.       _Version        =   393217
  93.       Icons           =   "ImageList2"
  94.       SmallIcons      =   "ImageList1"
  95.       ColHdrIcons     =   "ImageList1"
  96.       ForeColor       =   -2147483640
  97.       BackColor       =   -2147483643
  98.       BorderStyle     =   1
  99.       Appearance      =   1
  100.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  101.          Name            =   "宋体"
  102.          Size            =   9
  103.          Charset         =   134
  104.          Weight          =   400
  105.          Underline       =   0   'False
  106.          Italic          =   0   'False
  107.          Strikethrough   =   0   'False
  108.       EndProperty
  109.       OLEDragMode     =   1
  110.       OLEDropMode     =   1
  111.       NumItems        =   0
  112.    End
  113.    Begin VB.PictureBox picTitles 
  114.       Align           =   1  'Align Top
  115.       Appearance      =   0  'Flat
  116.       BorderStyle     =   0  'None
  117.       BeginProperty Font 
  118.          Name            =   "MS Sans Serif"
  119.          Size            =   8.25
  120.          Charset         =   0
  121.          Weight          =   400
  122.          Underline       =   0   'False
  123.          Italic          =   0   'False
  124.          Strikethrough   =   0   'False
  125.       EndProperty
  126.       ForeColor       =   &H80000008&
  127.       Height          =   300
  128.       Left            =   0
  129.       ScaleHeight     =   300
  130.       ScaleWidth      =   9240
  131.       TabIndex        =   1
  132.       TabStop         =   0   'False
  133.       Top             =   420
  134.       Width           =   9240
  135.       Begin VB.Label lblTitle 
  136.          BorderStyle     =   1  'Fixed Single
  137.          Caption         =   "百利/ERP"
  138.          Height          =   270
  139.          Index           =   0
  140.          Left            =   0
  141.          TabIndex        =   3
  142.          Tag             =   " 树形视图:"
  143.          Top             =   12
  144.          Width           =   2016
  145.       End
  146.       Begin VB.Label lblTitle 
  147.          BorderStyle     =   1  'Fixed Single
  148.          Caption         =   " 列表视图:"
  149.          Height          =   270
  150.          Index           =   1
  151.          Left            =   2078
  152.          TabIndex        =   2
  153.          Tag             =   " 列表视图:"
  154.          Top             =   12
  155.          Width           =   3216
  156.       End
  157.    End
  158.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  159.       Left            =   3360
  160.       Top             =   2160
  161.       _ExtentX        =   847
  162.       _ExtentY        =   847
  163.       _Version        =   393216
  164.    End
  165.    Begin MSComctlLib.TreeView tvTreeView 
  166.       Height          =   4800
  167.       Left            =   0
  168.       TabIndex        =   4
  169.       Top             =   705
  170.       Width           =   2010
  171.       _ExtentX        =   3545
  172.       _ExtentY        =   8467
  173.       _Version        =   393217
  174.       Indentation     =   564
  175.       LabelEdit       =   1
  176.       Style           =   7
  177.       ImageList       =   "ImageList1"
  178.       Appearance      =   1
  179.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  180.          Name            =   "宋体"
  181.          Size            =   9
  182.          Charset         =   134
  183.          Weight          =   400
  184.          Underline       =   0   'False
  185.          Italic          =   0   'False
  186.          Strikethrough   =   0   'False
  187.       EndProperty
  188.    End
  189.    Begin MSComctlLib.Toolbar tbToolBar 
  190.       Align           =   1  'Align Top
  191.       Height          =   420
  192.       Left            =   0
  193.       TabIndex        =   6
  194.       Top             =   0
  195.       Width           =   9240
  196.       _ExtentX        =   16298
  197.       _ExtentY        =   741
  198.       ButtonWidth     =   609
  199.       ButtonHeight    =   582
  200.       AllowCustomize  =   0   'False
  201.       Appearance      =   1
  202.       ImageList       =   "imlToolbarIcons"
  203.       _Version        =   393216
  204.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  205.          NumButtons      =   10
  206.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  207.             Style           =   3
  208.          EndProperty
  209.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  210.             Key             =   "返回"
  211.             Object.ToolTipText     =   "返回"
  212.             ImageKey        =   "xq"
  213.          EndProperty
  214.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  215.             Key             =   "向前"
  216.             Object.ToolTipText     =   "向前"
  217.             ImageKey        =   "xh"
  218.          EndProperty
  219.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  220.             Style           =   3
  221.          EndProperty
  222.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Style           =   3
  224.          EndProperty
  225.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  226.             Style           =   3
  227.          EndProperty
  228.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  229.             Key             =   "大图标"
  230.             Object.ToolTipText     =   "大图标"
  231.             ImageKey        =   "dtb"
  232.             Style           =   2
  233.             Value           =   1
  234.          EndProperty
  235.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  236.             Key             =   "小图标"
  237.             Object.ToolTipText     =   "小图标"
  238.             ImageKey        =   "xtb"
  239.             Style           =   2
  240.          EndProperty
  241.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  242.             Key             =   "列表"
  243.             Object.ToolTipText     =   "列表"
  244.             ImageKey        =   "lb"
  245.             Style           =   2
  246.          EndProperty
  247.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  248.             Key             =   "详细资料"
  249.             Object.ToolTipText     =   "详细资料"
  250.             ImageKey        =   "xxzl"
  251.             Style           =   2
  252.          EndProperty
  253.       EndProperty
  254.    End
  255.    Begin MSComctlLib.ImageList imlToolbarIcons 
  256.       Left            =   4710
  257.       Top             =   840
  258.       _ExtentX        =   1005
  259.       _ExtentY        =   1005
  260.       BackColor       =   -2147483643
  261.       ImageWidth      =   16
  262.       ImageHeight     =   16
  263.       MaskColor       =   12632256
  264.       _Version        =   393216
  265.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  266.          NumListImages   =   6
  267.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.             Picture         =   "系统_主操作桌面.frx":4546
  269.             Key             =   "xq"
  270.          EndProperty
  271.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  272.             Picture         =   "系统_主操作桌面.frx":48E0
  273.             Key             =   "xh"
  274.          EndProperty
  275.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  276.             Picture         =   "系统_主操作桌面.frx":4C7A
  277.             Key             =   "dtb"
  278.          EndProperty
  279.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  280.             Picture         =   "系统_主操作桌面.frx":5014
  281.             Key             =   "xtb"
  282.          EndProperty
  283.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  284.             Picture         =   "系统_主操作桌面.frx":53AE
  285.             Key             =   "lb"
  286.          EndProperty
  287.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  288.             Picture         =   "系统_主操作桌面.frx":5748
  289.             Key             =   "xxzl"
  290.          EndProperty
  291.       EndProperty
  292.    End
  293.    Begin MSComctlLib.ImageList ImageList2 
  294.       Left            =   6210
  295.       Top             =   2370
  296.       _ExtentX        =   1005
  297.       _ExtentY        =   1005
  298.       BackColor       =   -2147483643
  299.       ImageWidth      =   32
  300.       ImageHeight     =   32
  301.       MaskColor       =   12632256
  302.       _Version        =   393216
  303.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  304.          NumListImages   =   4
  305.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  306.             Picture         =   "系统_主操作桌面.frx":5AE2
  307.             Key             =   "y1"
  308.          EndProperty
  309.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  310.             Picture         =   "系统_主操作桌面.frx":5F36
  311.             Key             =   ""
  312.          EndProperty
  313.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  314.             Picture         =   "系统_主操作桌面.frx":6256
  315.             Key             =   "i"
  316.          EndProperty
  317.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  318.             Picture         =   "系统_主操作桌面.frx":72A8
  319.             Key             =   "y"
  320.          EndProperty
  321.       EndProperty
  322.    End
  323.    Begin VB.Image imgSplitter 
  324.       Height          =   4785
  325.       Left            =   4230
  326.       MousePointer    =   9  'Size W E
  327.       Top             =   750
  328.       Width           =   150
  329.    End
  330. End
  331. Attribute VB_Name = "Xt_Control"
  332. Attribute VB_GlobalNameSpace = False
  333. Attribute VB_Creatable = False
  334. Attribute VB_PredeclaredId = True
  335. Attribute VB_Exposed = False
  336. '***********************************************
  337. '*    模 块 名 称 :系统主操作桌面
  338. '*    功 能 描 述 :
  339. '*    程序员姓名  :张建忠
  340. '*    最后修改人  :张建忠
  341. '*    最后修改时间:2001/06/21
  342. '*    备        注:封版
  343. '***********************************************
  344. Const NAME_COLUMN = 0
  345. Const TYPE_COLUMN = 1
  346. Const SIZE_COLUMN = 2
  347. Const DATE_COLUMN = 3
  348. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  349.   
  350. Dim mbMoving As Boolean
  351. Const sglSplitLimit = 1000
  352. Dim nodX As Node
  353. Dim mitem As ListItem
  354. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  355. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  356. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  357. Dim Tsxx As String                           '系统提示信息
  358. Dim gnsyte As String                         '系统功能项索引
  359. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  360. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  361. Dim sjgnbmStr As String                      '上级编码
  362. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  363.     If lvListView.ListItems.count > 0 Then
  364.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  365.         If Not Xtgnbrec.EOF Then
  366.             If Xtgnbrec.Fields("mjbz") = True Then
  367.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  368.                 Call Zxxymk(gnsyte)
  369.             Else
  370.                 '---------------
  371.                 Dim sSql As String
  372.                 sjgnbmStr = ""
  373.                 lvListView.ColumnHeaders.Clear
  374.                 lvListView.ListItems.Clear
  375.                 sSql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  376.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(sSql)
  377.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  378.                 Do While Not Xtgnbrec.EOF
  379.                     Set mitem = lvListView.ListItems.Add()
  380.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  381.                     If Xtgnbrec.Fields("mjbz") Then
  382.                         mitem.SmallIcon = "gnqx"
  383.                         mitem.Icon = "y"
  384.                     Else
  385.                         mitem.Icon = "i"
  386.                         mitem.SmallIcon = "stb"
  387.                     End If
  388.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  389.                     Xtgnbrec.MoveNext
  390.                 Loop
  391.                 '---------------
  392.             End If
  393.         End If
  394.     End If
  395. End Sub
  396. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  397.     If KeyAscii = vbKeyReturn Then
  398.         Call lvListView_DblClick
  399.     End If
  400. End Sub
  401. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  402.     Dim sSql As String
  403.     If Node.Tag <> "" Then
  404.         If Node.Tag = False Then
  405.             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"
  406.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  407.                 Exit Sub
  408.             Else
  409.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  410.             End If
  411.         Else
  412.             sSql = "SELECT * FROM xt_xtgnb a," _
  413.                     & "(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"
  414.         End If
  415.         
  416.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(sSql)
  417.         If Node.Tag = True Then
  418.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  419.                 Exit Sub
  420.             Else
  421.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  422.             End If
  423.         End If
  424.         lvListView.ColumnHeaders.Clear
  425.         lvListView.ListItems.Clear
  426.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  427.         Do While Not Xtgnbrec.EOF
  428.             Set mitem = lvListView.ListItems.Add()
  429.             mitem.Text = Trim(Xtgnbrec!gnmc)
  430.             If Xtgnbrec.Fields("mjbz") Then
  431.                 mitem.SmallIcon = "gnqx"
  432.                 mitem.Icon = "y"
  433.             Else
  434.                 mitem.Icon = "i"
  435.                 mitem.SmallIcon = "stb"
  436.             End If
  437.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  438.             Xtgnbrec.MoveNext
  439.         Loop
  440.     End If
  441. End Sub
  442. Private Sub Cshgns()                                                    '初始化系统功能树
  443.   
  444.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '21%' and MenuList=1 order by gnbm")
  445.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP", "xttb"
  446.     With Xtgnbrec
  447.         Do While Not .EOF
  448.             If .Fields("mjbz") Then
  449.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  450.             Else
  451.                 If Trim(.Fields("sjgnbm")) = "" Then
  452.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  453.                 Else
  454.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  455.                 End If
  456.             End If
  457.             nodX.Tag = Xtgnbrec!mjbz
  458.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  459.                 nodX.EnsureVisible
  460.             End If
  461.             .MoveNext
  462.         Loop
  463.     End With
  464. End Sub
  465. '系统功能树操作
  466. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  467.   Cancel = 1
  468. End Sub
  469. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  470.     
  471.     If Node.Index <> 1 And Node.Key <> "T21" Then
  472.         Node.Image = "stb"
  473.     End If
  474.  
  475. End Sub
  476. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  477.     
  478.     If Node.Index <> 1 And Node.Key <> "T21" Then
  479.         Node.Image = "szk"
  480.     End If
  481. End Sub
  482. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  483.     
  484.     If KeyAscii = vbKeyReturn Then
  485.         Call tvTreeView_DblClick
  486.     End If
  487. End Sub
  488. Private Sub tvTreeView_DblClick()                                             '选择功能
  489.     
  490.     If tvTreeView.SelectedItem.Children = 0 Then
  491.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  492.         If Not Xtgnbrec.EOF Then
  493.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  494.             Call Zxxymk(gnsyte)
  495.         End If
  496.     End If
  497. End Sub
  498. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  499.   
  500.       '根据用户选择执行相应程序
  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.    
  510.     On Error GoTo Cwcl:
  511.     Select Case gnsy
  512.         '文件
  513.         Case "Rs_Register"                       '用户重新注册
  514.             XT_login.Show 1
  515.         Case "Rs_Exit"
  516.             Unload XT_Main
  517.         
  518.         '基础设置
  519.         Case "Rs_Set_RsItems"                   '人事项目设置
  520.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  521.             If Not Security_Log("Rs_Set_RsItems", Xtczybm, 1, True) Then
  522.                 Exit Sub
  523.             End If
  524.             Xtcdcs = 1
  525.             Set_RsItemsFrm.HelpContextID = 211200101
  526.             Set_RsItemsFrm.Show 1
  527.             Security_Log "Rs_Set_RsItems", Xtczybm, 2, False
  528.         Case "Rs_Set_Position"                  '人事项目排列
  529.             If Not Security_Log("Rs_Set_Position", Xtczybm, 1, True) Then
  530.                 Exit Sub
  531.             End If
  532.             Xtcdcs = 1
  533.             Set_PositionFrm.HelpContextID = 211200102
  534.             Set_PositionFrm.Show 1
  535.             Security_Log "Rs_Set_Position", Xtczybm, 2, False
  536.         
  537.         Case "Rs_Set_ArSort"                    '档案类别设置
  538.             If Not Security_Log("Rs_Set_ArSort", Xtczybm, 1, True) Then
  539.                 Exit Sub
  540.             End If
  541.             Set_ArSortFrm.HelpContextID = 211200103
  542.             Set_ArSortFrm.Show 1
  543.             Security_Log "Rs_Set_ArSort", Xtczybm, 2, False
  544.         Case "Rs_Set_ArItems"                   '档案细节设置
  545.             
  546.             If Not Security_Log("Rs_Set_ArItems", Xtczybm, 1, True) Then
  547.                 Exit Sub
  548.             End If
  549.             Set_ArItemsFrm.HelpContextID = 211200104
  550.             Set_ArItemsFrm.Show 1
  551.             Security_Log "Rs_Set_ArItems", Xtczybm, 2, False
  552.         Case "Rs_Set_HlpSort"                   '帮助类别设置
  553.             If Not Security_Log("Rs_Set_HlpSort", Xtczybm, 1, True) Then
  554.                 Exit Sub
  555.             End If
  556.             Set_HlpSortFrm.HelpContextID = 211200201
  557.             Set_HlpSortFrm.Show 1
  558.             Security_Log "Rs_Set_HlpSort", Xtczybm, 2, False
  559.         Case "Rs_Set_HlpList"                   '帮助明细设置
  560.             If Not Security_Log("Rs_Set_HlpList", Xtczybm, 1, True) Then
  561.                 Exit Sub
  562.             End If
  563.             Set_HlpListFrm.HelpContextID = 211200202
  564.             Set_HlpListFrm.Show 1
  565.             Security_Log "Rs_Set_HlpList", Xtczybm, 2, False
  566.         Case "Rs_Set_Qrt"                       '定员设置
  567.             If Not Security_Log("Rs_Set_Qrt", Xtczybm, 1, True) Then
  568.                 Exit Sub
  569.             End If
  570.             Set_QrtFrm.HelpContextID = 2112003
  571.             Set_QrtFrm.Show 1
  572.             Security_Log "Rs_Set_Qrt", Xtczybm, 2, False
  573.             
  574.         Case "Rs_PmItem"                          '外部接口
  575.             If Not Security_Log("Rs_PmItem", Xtczybm, 1, True) Then
  576.                 Exit Sub
  577.             End If
  578.             Set_PmItemFrm.HelpContextID = 2112004
  579.             Set_PmItemFrm.Show 1
  580.             
  581. '        '日常处理
  582.         Case "Rs_Ed_EmpArInfo"                     '个人档案维护
  583.             If Not Security_Log("Rs_Ed_EmpArInfo", Xtczybm, 1, True) Then
  584.                 Exit Sub
  585.             End If
  586.             AddExit_TF = True
  587.             Ed_EmpArInfoFrm.FormOwner = "Self"
  588.             Ed_EmpArInfoFrm.SysOwner = 0
  589.             Ed_EmpArInfoFrm.HelpContextID = 2113001
  590.             Ed_EmpArInfoFrm.Show 1
  591.             Security_Log "Rs_Ed_EmpArInfo", Xtczybm, 2, False
  592.         Case "Rs_Ed_EmpCorAr"                      '相关档案维护
  593.             If Not Security_Log("Rs_Ed_EmpCorAr", Xtczybm, 1, True) Then
  594.                 Exit Sub
  595.             End If
  596.             Ed_EmpCorArFrm.int_if = 1
  597.             Ed_EmpCorArFrm.HelpContextID = 2113002
  598.             Ed_EmpCorArFrm.Show 1
  599.             Security_Log "Rs_Ed_EmpCorAr", Xtczybm, 2, False
  600.         Case "Rs_Ed_EmpChg"                        '人事变动处理
  601.             If Not Security_Log("Rs_Ed_EmpChg", Xtczybm, 1, True) Then
  602.                 Exit Sub
  603.             End If
  604.             Xtcdcs = "1"
  605.             Ed_EmpChgFrm.HelpContextID = 2113003
  606.             Ed_EmpChgFrm.Show 1
  607.             Security_Log "Rs_Ed_EmpChg", Xtczybm, 2, False
  608.         '信息查询
  609.         Case "Rs_Qr_RsBasic"                       '人事信息查询
  610.             If Not Security_Log("Rs_Qr_RsBasic", Xtczybm, 1, True) Then
  611.                 Exit Sub
  612.             End If
  613.             Qr_RsBasicFrm.HelpContextID = 2114001
  614.             Qr_RsBasicFrm.Show
  615.             Qr_RsBscCndFrm.Show 1
  616.         Case "Rs_Qr_RsAr"                          '相关档案查询
  617.             If Not Security_Log("Rs_Qr_RsAr", Xtczybm, 1, True) Then
  618.                 Exit Sub
  619.             End If
  620.             Qr_RsArFrm.HelpContextID = 2114002
  621.             Qr_RsArFrm.Show
  622.             Qr_RsArCndFrm.Show 1
  623.         Case "Rs_Qr_RsChange"                      '人事变动查询
  624.             If Not Security_Log("Rs_Qr_RsChange", Xtczybm, 1, True) Then
  625.                 Exit Sub
  626.             End If
  627.             Qr_RsChgFrm.HelpContextID = 2114003
  628.             Qr_RsChgFrm.Show
  629.             Qr_RsChgCndFrm.Show 1
  630.         Case "Rs_Qr_RsQrt"                         '定员情况查询
  631.             If Not Security_Log("Rs_Qr_RsQrt", Xtczybm, 1, True) Then
  632.                 Exit Sub
  633.             End If
  634.             Qr_RsQrtFrm.HelpContextID = 2114004
  635.             Qr_RsQrtFrm.Show
  636.             Qr_RsQrtCndFrm.Show 1
  637.             
  638.         '统计分析
  639.         Case "Rs_An_RsRelation"                    '相关分析
  640.             If Not Security_Log("Rs_An_RsRelation", Xtczybm, 1, True) Then
  641.                 Exit Sub
  642.             End If
  643.             An_RsRelationFrm.HelpContextID = 2115001
  644.             An_RsRelationFrm.Show
  645.             An_RsRelationCndFrm.Show 1
  646.         Case "Rs_An_RsAge"                         '年龄分析
  647.             If Not Security_Log("Rs_An_RsAge", Xtczybm, 1, True) Then
  648.                 Exit Sub
  649.             End If
  650.             An_RsAgeFrm.HelpContextID = 2115002
  651.             An_RsAgeFrm.Show
  652.             An_RsAgeFrmQuery.Show 1
  653.         Case "Rs_An_RsAgeLong"                     '年资分析
  654.             If Not Security_Log("Rs_An_RsAgeLong", Xtczybm, 1, True) Then
  655.                 Exit Sub
  656.             End If
  657.             An_RsAgeLongFrm.HelpContextID = 2115003
  658.             An_RsAgeLongFrm.Show
  659.             An_RsAgeLongFrmQuery.Show 1
  660.             
  661.             
  662.         '工具
  663.         Case "Rs_Cal"                        '计算器
  664.             Shell App.Path & "calc.exe", vbNormalFocus
  665. '        Case "Rs_kmrl"                        '日历
  666. '            XT_kjrlFrm.Show 1
  667.         '帮助
  668.         Case "Rs_Comment"                           '系统帮助
  669.             Call F1bz
  670. '        Case "Rs_HxxdOnline"                        '网上新达
  671. '            Shell ("explorer http://www.hxxd.com"), vbNormalFocus
  672.         Case "Rs_About"                             '关于
  673.             XT_frmAbout.Show
  674.     End Select
  675.    
  676.     Exit Sub
  677. Cwcl:
  678.     Tsxx = "此项系统功能有待完善!"
  679.     Call Xtxxts(Tsxx, 0, 4)
  680.     Exit Sub
  681. End Sub
  682. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  683.   
  684.     If Unload_TF = False Then
  685.         Cancel = 1
  686.         Me.WindowState = 1
  687.     End If
  688. End Sub
  689. Private Sub Form_Load()
  690.     
  691.     '设置窗体图标
  692.     Me.Icon = XT_Main.Icon
  693.     
  694.     '设置窗体位置大小,并调入系统功能树
  695.     Me.Left = 0
  696.     Me.Top = 0
  697.     Me.Width = XT_Main.Width - 60
  698.     Me.Height = XT_Main.Height - 760 - 690
  699.     Call Cshgns
  700.     
  701.     '启动调入数据等待提示
  702.     Load Xt_Wait
  703.     
  704. End Sub
  705. Private Sub Form_Unload(Cancel As Integer)
  706.     
  707.     On Error Resume Next
  708.     
  709.     Dim i As Integer
  710.     For i = Forms.count - 1 To 1 Step -1
  711.         Unload Forms(i)
  712.     Next
  713.     If Me.WindowState <> vbMinimized Then
  714.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  715.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  716.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  717.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  718.     End If
  719.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  720. End Sub
  721. Private Sub Form_Resize()
  722.     
  723.     On Error Resume Next
  724.     If Me.Width < 3000 Then Me.Width = 3000
  725.     SizeControls imgSplitter.Left
  726. End Sub
  727. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  728.     
  729.     With imgSplitter
  730.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  731.     End With
  732.     picSplitter.Visible = True
  733.     mbMoving = True
  734. End Sub
  735. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  736.     
  737.     Dim sglPos As Single
  738.     If mbMoving Then
  739.         sglPos = x + imgSplitter.Left
  740.         If sglPos < sglSplitLimit Then
  741.             picSplitter.Left = sglSplitLimit
  742.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  743.             picSplitter.Left = Me.Width - sglSplitLimit
  744.         Else
  745.             picSplitter.Left = sglPos
  746.         End If
  747.     End If
  748. End Sub
  749. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  750.     
  751.     SizeControls picSplitter.Left
  752.     picSplitter.Visible = False
  753.     mbMoving = False
  754.     lvListView.Refresh
  755. End Sub
  756. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  757.     
  758.     If Source = imgSplitter Then
  759.         SizeControls x
  760.     End If
  761. End Sub
  762. Sub SizeControls(x As Single)
  763.     
  764.     On Error Resume Next
  765.     '设置 Width 属性
  766.     If x < 3500 Then x = 3500
  767.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  768.     tvTreeView.Width = x
  769.     imgSplitter.Left = x
  770.     lvListView.Left = x + 40
  771.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  772.     lblTitle(0).Width = tvTreeView.Width
  773.     lblTitle(1).Left = lvListView.Left + 20
  774.     lblTitle(1).Width = lvListView.Width - 40
  775.     '设置 Top 属性
  776.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  777.     lvListView.Top = tvTreeView.Top
  778.     '设置 height 属性
  779.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  780.     
  781.     lvListView.Height = tvTreeView.Height
  782.     imgSplitter.Top = tvTreeView.Top
  783.     imgSplitter.Height = tvTreeView.Height
  784. End Sub
  785. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  786.     
  787.     On Error Resume Next
  788.     
  789.     Select Case Button.Key
  790.         Case "返回"
  791.             tvTreeView.SetFocus
  792.               SendKeys "{up}", True
  793.         Case "向前"
  794.              tvTreeView.SetFocus
  795.               SendKeys "{DOWN}", True
  796.         Case "大图标"
  797.             lvListView.View = lvwIcon
  798.         Case "小图标"
  799.             lvListView.View = lvwSmallIcon
  800.         Case "列表"
  801.             lvListView.View = lvwList
  802.         Case "详细资料"
  803.             lvListView.View = lvwReport
  804.     End Select
  805. End Sub