上传用户: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 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      =   9240
  34.       TabIndex        =   2
  35.       TabStop         =   0   'False
  36.       Top             =   420
  37.       Width           =   9240
  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            =   4575
  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            =   5400
  86.       Top             =   825
  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":038A
  98.             Key             =   "stb"
  99.          EndProperty
  100.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.             Picture         =   "系统_主操作桌面.frx":13DC
  102.             Key             =   "xttb"
  103.          EndProperty
  104.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.             Picture         =   "系统_主操作桌面.frx":242E
  106.             Key             =   "szk"
  107.          EndProperty
  108.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.             Picture         =   "系统_主操作桌面.frx":27C8
  110.             Key             =   "gnqx1"
  111.          EndProperty
  112.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.             Picture         =   "系统_主操作桌面.frx":2C1A
  114.             Key             =   "kpgl1"
  115.          EndProperty
  116.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  117.             Picture         =   "系统_主操作桌面.frx":34F4
  118.             Key             =   "kpgl"
  119.          EndProperty
  120.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  121.             Picture         =   "系统_主操作桌面.frx":3DCE
  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           =   9240
  199.       _ExtentX        =   16298
  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":4168
  272.             Key             =   "xq"
  273.          EndProperty
  274.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  275.             Picture         =   "系统_主操作桌面.frx":4502
  276.             Key             =   "xh"
  277.          EndProperty
  278.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  279.             Picture         =   "系统_主操作桌面.frx":489C
  280.             Key             =   "dtb"
  281.          EndProperty
  282.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.             Picture         =   "系统_主操作桌面.frx":4C36
  284.             Key             =   "xtb"
  285.          EndProperty
  286.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  287.             Picture         =   "系统_主操作桌面.frx":4FD0
  288.             Key             =   "lb"
  289.          EndProperty
  290.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  291.             Picture         =   "系统_主操作桌面.frx":536A
  292.             Key             =   "xxzl"
  293.          EndProperty
  294.       EndProperty
  295.    End
  296.    Begin MSComctlLib.ImageList ImageList2 
  297.       Left            =   6075
  298.       Top             =   825
  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":5704
  310.             Key             =   "y1"
  311.          EndProperty
  312.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.             Picture         =   "系统_主操作桌面.frx":5B58
  314.             Key             =   ""
  315.          EndProperty
  316.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.             Picture         =   "系统_主操作桌面.frx":5E78
  318.             Key             =   "i"
  319.          EndProperty
  320.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.             Picture         =   "系统_主操作桌面.frx":6ECA
  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. 'Option Explicit
  340. '***********************************************
  341. '*    模 块 名 称 :系统主操作桌面
  342. '*    功 能 描 述 :
  343. '*    程序员姓名  :徐强
  344. '*    最后修改人  :徐强
  345. '*    最后修改时间:2001/06/21
  346. '*    备        注:
  347. '***********************************************
  348. Const NAME_COLUMN = 0
  349. Const TYPE_COLUMN = 1
  350. Const SIZE_COLUMN = 2
  351. Const DATE_COLUMN = 3
  352. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  353.   
  354. Dim mbMoving As Boolean
  355. Const sglSplitLimit = 1000
  356. Dim nodX As Node
  357. Dim mItem As ListItem
  358. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  359. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  360. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  361. Dim Tsxx As String                           '系统提示信息
  362. Dim gnsyte As String                         '系统功能项索引
  363. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  364. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  365. Dim sjgnbmStr As String                      '上级编码
  366. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  367.     If lvListView.ListItems.count > 0 Then
  368.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  369.         If Not Xtgnbrec.EOF Then
  370.             If Xtgnbrec.Fields("mjbz") = True Then
  371.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  372.                 Call Zxxymk(gnsyte)
  373.             Else
  374.                 '---------------
  375.                 Dim SSql As String
  376.                 sjgnbmStr = ""
  377.                 lvListView.ColumnHeaders.Clear
  378.                 lvListView.ListItems.Clear
  379.                 SSql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  380.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(SSql)
  381.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  382.                 Do While Not Xtgnbrec.EOF
  383.                     Set mItem = lvListView.ListItems.Add()
  384.                     mItem.Text = Trim(Xtgnbrec!gnmc)
  385.                     If Xtgnbrec.Fields("mjbz") Then
  386.                         mItem.SmallIcon = "gnqx"
  387.                         mItem.Icon = "y"
  388.                     Else
  389.                         mItem.Icon = "i"
  390.                         mItem.SmallIcon = "stb"
  391.                     End If
  392.                     mItem.Key = "T" & Trim(Xtgnbrec!gnbm)
  393.                     Xtgnbrec.MoveNext
  394.                 Loop
  395.                 '---------------
  396.             End If
  397.         End If
  398.     End If
  399. End Sub
  400. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  401.     If KeyAscii = vbKeyReturn Then
  402.         Call lvListView_DblClick
  403.     End If
  404. End Sub
  405. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  406.     Dim SSql As String
  407.     If Node.Tag <> "" Then
  408.         If Node.Tag = False Then
  409.             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"
  410.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  411.                 Exit Sub
  412.             Else
  413.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  414.             End If
  415.         Else
  416.             SSql = "SELECT * FROM xt_xtgnb a," _
  417.                     & "(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"
  418.         End If
  419.         
  420.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(SSql)
  421.         If Node.Tag = True Then
  422.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  423.                 Exit Sub
  424.             Else
  425.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  426.             End If
  427.         End If
  428.         lvListView.ColumnHeaders.Clear
  429.         lvListView.ListItems.Clear
  430.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  431.         Do While Not Xtgnbrec.EOF
  432.             Set mItem = lvListView.ListItems.Add()
  433.             mItem.Text = Trim(Xtgnbrec!gnmc)
  434.             If Xtgnbrec.Fields("mjbz") Then
  435.                 mItem.SmallIcon = "gnqx"
  436.                 mItem.Icon = "y"
  437.             Else
  438.                 mItem.Icon = "i"
  439.                 mItem.SmallIcon = "stb"
  440.             End If
  441.             mItem.Key = "T" & Trim(Xtgnbrec!gnbm)
  442.             Xtgnbrec.MoveNext
  443.         Loop
  444.     End If
  445. End Sub
  446. Public Sub Cshgns()                                                    '初始化系统功能树
  447.   
  448.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '33%' and MenuList=1 order by gnbm")
  449.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  450.     With Xtgnbrec
  451.         Do While Not .EOF
  452.             If .Fields("mjbz") Then
  453.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  454.             Else
  455.                 If Trim(.Fields("sjgnbm")) = "" Then
  456.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  457.                 Else
  458.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  459.                 End If
  460.             End If
  461.             nodX.Tag = Xtgnbrec!mjbz
  462.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  463.                 nodX.EnsureVisible
  464.             End If
  465.             .MoveNext
  466.         Loop
  467.     End With
  468. End Sub
  469. '系统功能树操作
  470. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  471.   Cancel = 1
  472. End Sub
  473. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  474.     
  475.     If Node.Index <> 1 And Node.Key <> "T33" Then
  476.         Node.Image = "stb"
  477.     End If
  478.  
  479. End Sub
  480. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  481.     
  482.     If Node.Index <> 1 And Node.Key <> "T33" Then
  483.         Node.Image = "szk"
  484.     End If
  485. End Sub
  486. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  487.     
  488.     If KeyAscii = vbKeyReturn Then
  489.         Call tvTreeView_DblClick
  490.     End If
  491. End Sub
  492. Private Sub tvTreeView_DblClick()                                             '选择功能
  493.     
  494.     If tvTreeView.SelectedItem.Children = 0 Then
  495.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  496.         If Not Xtgnbrec.EOF Then
  497.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  498.             Call Zxxymk(gnsyte)
  499.         End If
  500.     End If
  501. End Sub
  502. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  503.   
  504.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  505.     Dim Sqlstr As String                   '临时查询字符串
  506.   
  507.     If Len(Trim(gnsy)) = 0 Then
  508.         Exit Sub
  509.     End If
  510.     
  511.     On Error GoTo Cwcl:
  512.     Select Case gnsy
  513.         '文件
  514.         Case "Gy_register"                       '用户重新注册
  515.             XT_login.Show 1
  516.         Case "Gy_quit"
  517.             Unload XT_Main
  518.      
  519.             '1.录入类型
  520.         Case "Gy_CodeScheme"         '编码方案
  521.             Gy_CodeScheme.HelpContextID = 33120016
  522.             Gy_CodeScheme.Show 1
  523.            
  524.         Case "Gy_Customer"           '客户设置
  525.             Gy_Customer.HelpContextID = 3312005
  526.             Gy_Customer.Show
  527.             Gy_CustomerQuery.Show 1
  528.            
  529.         Case "Gy_Department"         '部门设置
  530.             Gy_Department.HelpContextID = 3312001
  531.             Gy_Department.Show 1
  532.            
  533.         Case "Gy_ForeignCurrency"    '币种
  534.             Gy_ForeignCurrency.HelpContextID = 33120012
  535.             Gy_ForeignCurrency.Show 1
  536.            
  537.         Case "Gy_InOutClass"         '收发类别
  538.             Gy_InOutClass.HelpContextID = 33120014
  539.             Gy_InOutClass.Show 1
  540.         
  541.         Case "Gy_Material"           '物料档案
  542.             Gy_Material.HelpContextID = 3312004
  543.             Gy_Material.Show
  544.             Gy_MaterialQuery.Show 1
  545.            
  546.         Case "Gy_PayCon"             '付款条件
  547.             Gy_PayCon.HelpContextID = 33120013
  548.             Gy_PayCon.Show 1
  549.            
  550.         Case "Gy_Person"             '职员
  551.             Gy_Person.HelpContextID = 3312002
  552.             Gy_Person.Show 1
  553.                       
  554.         Case "Gy_Supplier"           '供应商
  555.             Gy_Supplier.HelpContextID = 3312007
  556.             Gy_Supplier.Show
  557.             Gy_SupplierQuery.Show 1
  558.            
  559.         Case "Gy_BillNumber"         '单据
  560.             Gy_BillNumber.HelpContextID = 33120015
  561.             Gy_BillNumber.Show 1
  562.            
  563.         Case "Gy_Warehouse"          '仓库档案
  564.             Gy_Warehouse.HelpContextID = 3312003
  565.             Gy_Warehouse.Show 1
  566.             
  567.         Case "Gy_TransferCompany"    '承运单位
  568.             Gy_TransferCompany.HelpContextID = 3312008
  569.             Gy_TransferCompany.Show 1
  570.             
  571.    '**********************************************简单设置
  572.         Case "Gy_Settlement"
  573.            With Gy_BaseSet
  574.                 XtReportCode = "Gy_Settlement"
  575.                 .ReportTitle = "结算方式设置"
  576.                 .TextGroupCode = "Gy_Settlement"
  577.                 .GridCode = "Gy_Settlement"
  578.                 .Str_RightEdit = "Gy_Settlement_Edit"
  579.                 .str_TableName = "Gy_Settlement"
  580.                 .str_FieldCode = "SSCode"
  581.                 .str_FieldName = "SSName"
  582.                 .str_Label = "结算方式"
  583.                 .Caption = "结算方式设置"
  584.                 .HelpContextID = 33120011
  585.                 .Show 1
  586.             End With
  587.            
  588.         Case "Gy_TransferWay"
  589.            With Gy_BaseSet
  590.                 XtReportCode = "Gy_TransferWay"
  591.                 .ReportTitle = "运输方式设置"
  592.                 .TextGroupCode = "Gy_TransferWay"
  593.                 .GridCode = "Gy_TransferWay"
  594.                 .Str_RightEdit = "Gy_TransferWay_Edit"
  595.                 .str_TableName = "Gy_TransferWay"
  596.                 .str_FieldCode = "TransferWayCode"
  597.                 .str_FieldName = "TransferWayName"
  598.                 .str_Label = "运输方式"
  599.                 .Caption = "运输方式设置"
  600.                 .HelpContextID = 3312009
  601.                 .Show 1
  602.             End With
  603.            
  604.         Case "Gy_UnitSet"
  605.             With Gy_BaseSet
  606.                 XtReportCode = "Gy_UnitSet"
  607.                 .ReportTitle = "计量单位设置"
  608.                 .TextGroupCode = "Gy_UnitSet"
  609.                 .GridCode = "Gy_UnitSet"
  610.                 .Str_RightEdit = "Gy_UnitSet_Edit"
  611.                 .str_TableName = "Gy_UnitSet"
  612.                 .str_FieldCode = "UnitCode"
  613.                 .str_FieldName = "UnitName"
  614.                 .str_Label = "计量单位"
  615.                 .Caption = "计量单位设置"
  616.                 .HelpContextID = 33120010
  617.                 .Show 1
  618.             End With
  619.     '**********************************************简单分类
  620.         Case "Gy_SupplierSort"
  621.             With Gy_BaseSortSet
  622.                 XtReportCode = "Gy_SupplierSort"
  623.                 .ReportTitle = "供应商分类设置"
  624.                 
  625.                 .TextGroupCode = "Gy_SupplierSort"
  626.                 .GridCode = "Gy_SupplierSort"
  627.                 .Str_RightEdit = "Gy_SupplierSort_Edit"
  628.                 .CodSchemeIndex = "Gy_SupplierSort"
  629.                 
  630.                 .str_TableName = "Gy_SupplierSort"
  631.                 .str_SortCode = "SupplierSortCode"
  632.                 .str_SortName = "SupplierSortName"
  633.                 .str_Label = "供应商分类"
  634.                 .Caption = "供应商分类设置"
  635.                 .HelpContextID = 3312006
  636.                 .Show 1
  637.             End With
  638.             
  639.         Case "Cg_AreaSet"
  640.             With Gy_BaseSortSet
  641.                 XtReportCode = "Cg_AreaSet"
  642.                 .ReportTitle = "供应商地区分类设置"
  643.                 .TextGroupCode = "Cg_AreaSet"
  644.                 .GridCode = "gy_AreaSet"
  645.                 .Str_RightEdit = "Cg_AreaSet_Edit"
  646.                 .CodSchemeIndex = "Cg_AreaSet"
  647.                 .str_TableName = "Cg_AreaSet"
  648.                 .str_SortCode = "AreaCode"
  649.                 .str_SortName = "AreaName"
  650.                 .str_Label = "供应商地区分类"
  651.                 .Caption = "供应商地区分类设置"
  652.                 .HelpContextID = 33120017
  653.                 .Show 1
  654.             End With
  655.         Case "Cg_TradeSet"
  656.             With Gy_BaseSortSet
  657.                 XtReportCode = "Cg_TradeSet"
  658.                 .ReportTitle = "供应商行业分类设置"
  659.                 .TextGroupCode = "Cg_TradeSet"
  660.                 .GridCode = "gy_TradeSet"
  661.                 .Str_RightEdit = "GCg_TradeSet_Edit"
  662.                 .CodSchemeIndex = "Cg_TradeSet"
  663.                 .str_TableName = "Cg_TradeSet"
  664.                 .str_SortCode = "TradeCode"
  665.                 .str_SortName = "TradeName"
  666.                 .str_Label = "供应商行业分类"
  667.                 .Caption = "供应商行业分类设置"
  668.                 .HelpContextID = 33120018
  669.                 .Show 1
  670.             End With
  671.     '*********************************************
  672.         '单据设计
  673.         Case "c_BillDesign"                     '单据录入设计
  674.             XT_BillDesign.Show
  675.         Case "c_BillPrintDesign"                '单据打印设计
  676.             XT_BillPrintDesign.Show
  677.           
  678.         '工具
  679.         Case "Gy_gnbmkmrl"                       '会计日历
  680.             XT_kjrlFrm.Show 1
  681.         Case "Gy_gnbmjsq"                        '计算器
  682.             Shell App.Path & "calc.exe", vbNormalFocus
  683.         
  684.         '帮助
  685.         Case "Gy_xtbz"                           '系统帮助
  686.             Call F1bz
  687.         Case "Gy_gy"                             '关于
  688.             XT_frmAbout.Show
  689.     End Select
  690.     
  691.     '用户退出时写上机日志
  692.    Security_Log gnsy, Xtczybm, 2, False
  693.    
  694.     Exit Sub
  695. Cwcl:
  696.     Tsxx = "此项系统功能有待完善!"
  697.     Call Xtxxts(Tsxx, 0, 4)
  698.     Exit Sub
  699. End Sub
  700. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  701.   
  702.     If Unload_TF = False Then
  703.         Cancel = 1
  704.         Me.WindowState = 1
  705.     End If
  706. End Sub
  707. Private Sub Form_Load()
  708.     
  709.     '设置窗体图标
  710.     Me.Icon = XT_Main.Icon
  711.     
  712.     '设置窗体位置大小,并调入系统功能树
  713.     Me.Left = 0
  714.     Me.Top = 0
  715.     Me.Width = XT_Main.Width - 60
  716.     Me.Height = XT_Main.Height - 760 - 690
  717.     Call Cshgns
  718.     
  719.     '启动调入数据等待提示
  720.     Load Xt_Wait
  721.     
  722. End Sub
  723. Private Sub Form_Unload(Cancel As Integer)
  724.     
  725.     On Error Resume Next
  726.     
  727.     Dim i As Integer
  728.     For i = Forms.count - 1 To 1 Step -1
  729.         Unload Forms(i)
  730.     Next
  731.     If Me.WindowState <> vbMinimized Then
  732.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  733.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  734.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  735.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  736.     End If
  737.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  738. End Sub
  739. Private Sub Form_Resize()
  740.     
  741.     On Error Resume Next
  742.     If Me.Width < 3000 Then Me.Width = 3000
  743.     SizeControls imgSplitter.Left
  744. End Sub
  745. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  746.     
  747.     With imgSplitter
  748.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  749.     End With
  750.     picSplitter.Visible = True
  751.     mbMoving = True
  752. End Sub
  753. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  754.     
  755.     Dim sglPos As Single
  756.     If mbMoving Then
  757.         sglPos = X + imgSplitter.Left
  758.         If sglPos < sglSplitLimit Then
  759.             picSplitter.Left = sglSplitLimit
  760.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  761.             picSplitter.Left = Me.Width - sglSplitLimit
  762.         Else
  763.             picSplitter.Left = sglPos
  764.         End If
  765.     End If
  766. End Sub
  767. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  768.     
  769.     SizeControls picSplitter.Left
  770.     picSplitter.Visible = False
  771.     mbMoving = False
  772.     lvListView.Refresh
  773. End Sub
  774. Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
  775.     
  776.     If Source = imgSplitter Then
  777.         SizeControls X
  778.     End If
  779. End Sub
  780. Sub SizeControls(X As Single)
  781.     
  782.     On Error Resume Next
  783.     '设置 Width 属性
  784.     If X < 3500 Then X = 3500
  785.     If X > (Me.Width - 1500) Then X = Me.Width - 1500
  786.     tvTreeView.Width = X
  787.     imgSplitter.Left = X
  788.     lvListView.Left = X + 40
  789.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  790.     lblTitle(0).Width = tvTreeView.Width
  791.     lblTitle(1).Left = lvListView.Left + 20
  792.     lblTitle(1).Width = lvListView.Width - 40
  793.     '设置 Top 属性
  794.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  795.     lvListView.Top = tvTreeView.Top
  796.     '设置 height 属性
  797.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  798.     
  799.     lvListView.Height = tvTreeView.Height
  800.     imgSplitter.Top = tvTreeView.Top
  801.     imgSplitter.Height = tvTreeView.Height
  802. End Sub
  803. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  804.     
  805.     On Error Resume Next
  806.     
  807.     Select Case Button.Key
  808.         Case "返回"
  809.             tvTreeView.SetFocus
  810.               SendKeys "{up}", True
  811.         Case "向前"
  812.              tvTreeView.SetFocus
  813.               SendKeys "{DOWN}", True
  814.         Case "大图标"
  815.             lvListView.View = lvwIcon
  816.         Case "小图标"
  817.             lvListView.View = lvwSmallIcon
  818.         Case "列表"
  819.             lvListView.View = lvwList
  820.         Case "详细资料"
  821.             lvListView.View = lvwReport
  822.     End Select
  823. End Sub