⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmusu_helpdepartment.frm

📁 一个用VB写的财务软件源码
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmUSU_HelpDepartment 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "输入参照 - 部门"
   ClientHeight    =   6810
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5685
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6810
   ScaleWidth      =   5685
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消(&C)"
      Height          =   345
      Left            =   3278
      TabIndex        =   2
      Top             =   6360
      Width           =   1065
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      Height          =   345
      Left            =   1358
      TabIndex        =   1
      Top             =   6360
      Width           =   1065
   End
   Begin MSComctlLib.TreeView tVw 
      Height          =   6225
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5685
      _ExtentX        =   10028
      _ExtentY        =   10980
      _Version        =   393217
      HideSelection   =   0   'False
      LabelEdit       =   1
      Style           =   7
      ImageList       =   "ImageList2"
      Appearance      =   1
   End
   Begin MSComctlLib.ImageList ImageList2 
      Left            =   240
      Top             =   6240
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpDepartment.frx":0000
            Key             =   "Root"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpDepartment.frx":0460
            Key             =   "Collapse"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpDepartment.frx":08C0
            Key             =   "Expand"
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmUSU_HelpDepartment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Const sTABLECG = "tUSU_Department"
Const sFIELD_CODECG = "cDepCode"
Const sFIELD_NAMECG = "cDepName"
Const sFIELD_DEGREECG = "iDepGrade"
Const sFIELD_ENDCG = "bDepEnd"

Const sTitle = "部门"
Const sITEM = "部门"

Dim CUsual As clsContentsSet


Public OK As Boolean

Private m_sCode As String
Private m_sName As String
Private m_bEnableSelectAll As Boolean

Public Property Get usCode() As String
    usCode = m_sCode
End Property

Public Property Get usName() As String
    usName = m_sName
End Property

Public Property Let ubEnableSelectAll(ByVal value As Boolean)
    m_bEnableSelectAll = value
End Property

Private Sub form_load()
    Dim rSt As ADODB.Recordset
    Dim aryLen() As Integer
    Dim i As Long
    
    m_bEnableSelectAll = False
    
    Set rSt = New ADODB.Recordset
    With rSt
        .CursorLocation = adUseClient
        .Open "SELECT * FROM tUSU_dmjs WHERE Type='" & _
                sITEM & "' ORDER BY JC", _
            glo.cnnMain, adOpenStatic, adLockReadOnly
        ReDim aryLen(.RecordCount)
        i = 0
        Do Until .EOF
            aryLen(i) = .Fields("WS").value
            .MoveNext
            i = i + 1
        Loop
        .Close
    End With
            
    Set CUsual = New clsContentsSet
    With CUsual
        .TypeOfContents = ctLevel
        .DBConnection = glo.cnnMain
        .TableCG = sTABLECG & glo.sOperateYear
        .FieldCodeCG = sFIELD_CODECG
        .FieldNameCG = sFIELD_NAMECG
        .FieldLevelCG = sFIELD_DEGREECG
        .FieldEndCG = sFIELD_ENDCG
        .OtherFieldCount = 0
        .TreeView = tVw
        .RootKey = "R"
        .RootText = sTitle
        .NodeKeyPrefixCG = "K"
        .ImageRootUnSelected = "Root"
        .ImageNodeUnSelectedCG = "Collapse"
        .ImageNodeSelectedCG = "Expand"
        .LevelsCG = UBound(aryLen)
        .LevelLenCG = aryLen()
        .LoadTvwCategory
    End With
    
    Call tVw_NodeClick(tVw.Nodes(CUsual.RootKey))

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If UnloadMode = vbFormControlMenu Then
        Cancel = 1
        Call cmdCancel_Click
    End If
End Sub





Private Sub cmdOk_Click()
    With tVw.SelectedItem
        If .Key <> "R" Then
            If .Children = 0 Or m_bEnableSelectAll = True Then
                m_sCode = Mid$(.Key, 2)
                m_sName = Mid$(.text, InStr(1, .text, "=") + 1)
                OK = True
                Me.Hide
            End If
        End If
    End With
End Sub

Private Sub cmdCancel_Click()
    OK = False
    Me.Hide
End Sub





Private Sub tVw_DblClick()
    If tVw.SelectedItem.Key Like CUsual.NodeKeyPrefixCG & "*" Then
        Call cmdOk_Click
    End If
End Sub

Private Sub tVw_NodeClick(ByVal Node As MSComctlLib.Node)
    cmdOk.Enabled = (Node.Key Like CUsual.NodeKeyPrefixCG & "*")
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -