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

📄 frmusu_helppjlx.frm

📁 一个用VB写的财务软件源码
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmUSU_HelpPjlx 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "输入参照 - 票据类型"
   ClientHeight    =   6810
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5340
   Icon            =   "frmUSU_HelpPjlx.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6810
   ScaleWidth      =   5340
   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
      Style           =   5
      FullRowSelect   =   -1  'True
      ImageList       =   "itv"
      Appearance      =   1
   End
   Begin MSComctlLib.ImageList ilsTvw 
      Left            =   240
      Top             =   6120
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   6
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":000C
            Key             =   "Root"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":0460
            Key             =   "UnSelected"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":08B4
            Key             =   "Selected"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":0D08
            Key             =   "Expand"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":115C
            Key             =   "Collapse"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":15B0
            Key             =   "SelectedDqr"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList itv 
      Left            =   0
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   6
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":1A02
            Key             =   "Root"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":2C86
            Key             =   "Expand"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":30DA
            Key             =   "Collapse"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":352E
            Key             =   "UnSelected"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":3982
            Key             =   "Selected"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUSU_HelpPjlx.frx":3DD6
            Key             =   "SelectedDqr"
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmUSU_HelpPjlx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Const sTitle = "票据类型"
Public Valid As Boolean
Private m_bDqr As Boolean
Private m_sCode As String
Private m_sName As String
Private m_iNumber As Integer

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

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

Public Property Get uiNumber() As Integer
uiNumber = m_iNumber
End Property

Public Property Get ubDqr() As Boolean
ubDqr = m_bDqr
End Property

Public Sub RefreshVar()
With tVw.SelectedItem
    m_sCode = Mid$(.Key, 2)
    m_sName = Mid$(.text, InStr(1, .text, "=") + 1)
    If IsNumeric(.Tag) = True Then
        m_iNumber = CInt(.Tag)
    Else
        m_iNumber = 0
    End If
    If .SelectedImage = "SelectedDqr" Then
        m_bDqr = True
    Else
        m_bDqr = False
    End If
End With
End Sub

Private Sub cmdOk_Click()
    RefreshVar
    If m_sCode = "" Or tVw.SelectedItem.Children > 0 Then
        Valid = False
        m_sCode = ""
        m_sName = ""
        m_iNumber = 0
        MsgBox "请选择项目", vbInformation
        Exit Sub
    End If
    Valid = True
    Me.Hide
End Sub

Private Sub Form_Activate()
Valid = False
End Sub

Private Sub form_load()
    Dim rSt As New ADODB.Recordset
    Dim aryLen() As Integer
    Dim i As Long
    Valid = False
    rSt.CursorLocation = adUseClient
rSt.Open "select * from tysyf_billtype where cyear='" + glo.sOperateYear + "' order by cCode", glo.cnnMain, adOpenKeyset, adLockPessimistic

tVw.Nodes.Add , , "R", sTitle, "Root"
Call pubSectionLoadTvw(rSt, tVw, "R", "ccode", "cname", "", "")
rSt.Close
tVw.Nodes("R").Expanded = True
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 cmdCancel_Click()
    Valid = False
    Me.Hide
End Sub

Private Sub Form_Unload(Cancel As Integer)
Valid = False
End Sub

Private Sub tVw_DblClick()
Dim CUsual As New clsContentsSet
If tVw.SelectedItem.Key Like CUsual.NodeKeyPrefix & "*" Then
    Call cmdOk_Click
End If
End Sub


 Public Function pubSectionLoadTvw(ByVal rSt As ADODB.Recordset, tVw As TreeView, _
                                        ByVal sStrRoot As String, sCode As String, _
                                        sName As String, sColle As String, sExpd As String)
Dim tNode As Node
If Not rSt.BOF Then rSt.MoveFirst
While Not rSt.EOF
       If rSt.Fields("IsDqr").Value Then
        Set tNode = tVw.Nodes.Add(sStrRoot, tvwChild, "y" & Trim$("" _
                    & rSt.Fields(sCode)), Trim$("" & rSt.Fields(sCode)) & "=" _
                    & Trim$("" & rSt.Fields(sName)), "UnSelected", "SelectedDqr")
       Else
        Set tNode = tVw.Nodes.Add(sStrRoot, tvwChild, "y" & Trim$("" _
                    & rSt.Fields(sCode)), Trim$("" & rSt.Fields(sCode)) & "=" _
                    & Trim$("" & rSt.Fields(sName)), "UnSelected", "Selected")
       End If
       tNode.Tag = rSt.Fields("cNumber").Value
       rSt.MoveNext
Wend
End Function

⌨️ 快捷键说明

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